Package com.mindee.input
Class LocalInputSource
- java.lang.Object
-
- com.mindee.input.LocalInputSource
-
public final 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(Integer quality)voidcompress(Integer quality, Integer maxWidth)voidcompress(Integer quality, Integer maxWidth, Integer maxHeight)voidcompress(Integer quality, Integer maxWidth, Integer maxHeight, Boolean forceSourceText)voidcompress(Integer quality, Integer maxWidth, Integer maxHeight, Boolean forceSourceText, Boolean disableSourceText)byte[]getFile()StringgetFilename()intgetPageCount()Get the number of pages in the document.booleanhasSourceText()booleanisPdf()
-
-
-
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
-
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()
-
hasSourceText
public boolean hasSourceText()
-
compress
public void compress(Integer quality, Integer maxWidth, Integer maxHeight, Boolean forceSourceText, Boolean disableSourceText) throws IOException
- Throws:
IOException
-
compress
public void compress(Integer quality, Integer maxWidth, Integer maxHeight, Boolean forceSourceText) throws IOException
- Throws:
IOException
-
compress
public void compress(Integer quality, Integer maxWidth, Integer maxHeight) throws IOException
- Throws:
IOException
-
compress
public void compress(Integer quality, Integer maxWidth) throws IOException
- Throws:
IOException
-
compress
public void compress(Integer quality) throws IOException
- Throws:
IOException
-
compress
public void compress() throws IOException- Throws:
IOException
-
getFile
public byte[] getFile()
-
getFilename
public String getFilename()
-
-