Package com.mindee.pdf
Class ExtractedPDF
- java.lang.Object
-
- com.mindee.pdf.ExtractedPDF
-
public class ExtractedPDF extends Object
An extracted sub-PDF.
-
-
Constructor Summary
Constructors Constructor Description ExtractedPDF(byte[] fileBytes, String filename, int[] pageIndexes)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalInputSourceasInputSource()Return the file in a format suitable for sending to MindeeClient for parsing.byte[]getFileBytes()PDF content as bytes.StringgetFilename()Name of the file when writing to disk.intgetPageCount()The number of pages in this PDF file.int[]getPageIndexes()0-based indexes of all pages taken from the original PDF.voidwriteToFile(String outputPath)Write the extracted PDF to a file.voidwriteToFile(Path outputPath)Write the extracted PDF to a file.
-
-
-
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.
-
-