Class ExtractedPDF


  • public class ExtractedPDF
    extends Object
    An extracted sub-PDF.
    • Constructor Detail

      • ExtractedPDF

        public ExtractedPDF​(byte[] fileBytes,
                            String filename,
                            int[] pageIndexes)
        Default constructor.
        Parameters:
        fileBytes - PDF file as bytes.
        filename - Name of the extracted file.
        pageIndexes - Two-element array: index of the first and last extracted page.
    • Method Detail

      • writeToFile

        public void writeToFile​(Path outputPath)
                         throws MindeeException
        Write the extracted PDF to a file.
        Parameters:
        outputPath - the output path, it may be a file or a directory.
        Throws:
        MindeeException
      • writeToFile

        public void writeToFile​(String outputPath)
                         throws MindeeException
        Write the extracted PDF to a file.
        Parameters:
        outputPath - the output path, it may be a file or a directory.
        Throws:
        MindeeException
      • asInputSource

        public LocalInputSource asInputSource()
        Return the file in a format suitable for sending to MindeeClient for parsing.
        Returns:
        an instance of LocalInputSource
      • getFileBytes

        public byte[] getFileBytes()
        PDF content as bytes.
      • getFilename

        public String getFilename()
        Name of the file when writing to disk.
      • getPageIndexes

        public int[] getPageIndexes()
        0-based indexes of all pages taken from the original PDF.
      • getPageCount

        public int getPageCount()
        The number of pages in this PDF file.