Package com.mindee.input
Class LocalInputSource
- java.lang.Object
-
- com.mindee.input.LocalInputSource
-
public class LocalInputSource extends Object
A source document for Mindee API operations.
-
-
Constructor Summary
Constructors Constructor Description LocalInputSource(byte[] fileAsByteArray, String filename)LocalInputSource(File file)LocalInputSource(InputStream file, String filename)LocalInputSource(String filePath)LocalInputSource(String fileAsBase64, String filename)LocalInputSource(Path filePath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyPageOptions(PageOptions pageOptions)Applies PDF-specific operations on the current file based on the specifiedPageOptions.voidcompress()voidcompress(int quality)voidcompress(int quality, boolean forceSourceText, boolean disableSourceText)voidcompress(int quality, Integer maxWidth, Integer maxHeight)voidcompress(int quality, Integer maxWidth, Integer maxHeight, Boolean forceSourceText)voidcompress(int quality, Integer maxWidth, Integer maxHeight, Boolean forceSourceText, Boolean disableSourceText)byte[]getFile()StringgetFilename()intgetPageCount()Get the number of pages in the document.protected PDFCompressiongetPDFCompressor()Get the PDFCompression instance.protected PDFInputOperationgetPDFInputOperator()Get the PDFInputOperation instance.booleanisPDF()Returns true if the file is a PDF.
-
-
-
Constructor Detail
-
LocalInputSource
public LocalInputSource(InputStream file, String filename) throws IOException
- Throws:
IOException
-
LocalInputSource
public LocalInputSource(String filePath) throws IOException
- Throws:
IOException
-
LocalInputSource
public LocalInputSource(Path filePath) throws IOException
- Throws:
IOException
-
LocalInputSource
public LocalInputSource(File file) throws IOException
- Throws:
IOException
-
LocalInputSource
public LocalInputSource(byte[] fileAsByteArray, String filename)
-
-
Method Detail
-
getPDFInputOperator
protected PDFInputOperation getPDFInputOperator()
Get the PDFInputOperation instance. Override this method to provide custom PDF input handling.- Returns:
- PDFInputOperation instance
-
getPDFCompressor
protected PDFCompression getPDFCompressor()
Get the PDFCompression instance. Override this method to provide custom PDF compression handling.- Returns:
- PDFCompression instance
-
getPageCount
public int getPageCount() throws IOExceptionGet the number of pages in the document.- Returns:
- the number of pages in the current file.
- Throws:
IOException- If an I/O error occurs during the PDF operation.
-
applyPageOptions
public void applyPageOptions(PageOptions pageOptions) throws IOException
Applies PDF-specific operations on the current file based on the specifiedPageOptions.- Parameters:
pageOptions- The options specifying which pages to modify or retain in the PDF file.- Throws:
IOException- If an I/O error occurs during the PDF operation.
-
isPDF
public boolean isPDF()
Returns true if the file is a PDF.
-
compress
public void compress(int quality, Integer maxWidth, Integer maxHeight, Boolean forceSourceText, Boolean disableSourceText) throws IOException- Throws:
IOException
-
compress
public void compress(int quality, Integer maxWidth, Integer maxHeight, Boolean forceSourceText) throws IOException- Throws:
IOException
-
compress
public void compress(int quality, boolean forceSourceText, boolean disableSourceText) throws IOException- Throws:
IOException
-
compress
public void compress(int quality, Integer maxWidth, Integer maxHeight) throws IOException- Throws:
IOException
-
compress
public void compress(int quality) throws IOException- Throws:
IOException
-
compress
public void compress() throws IOException- Throws:
IOException
-
getFile
public byte[] getFile()
-
getFilename
public String getFilename()
-
-