Class OcrOptions
- java.lang.Object
-
- com.pdftools.internal.NativeBase
-
- com.pdftools.internal.NativeObject
-
- com.pdftools.ocr.OcrOptions
-
public class OcrOptions extends NativeObject
The options for OCR processing
This class aggregates all OCR processing options including resolution settings, image processing, text processing and page processing.
-
-
Constructor Summary
Constructors Constructor Description OcrOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetDpi()The default resolution in DPI used for OCR (Getter)ImageOptionsgetImageOptions()The options for image processing (Getter)doublegetMaxDpi()The maximum resolution in DPI used for OCR (Getter)doublegetMinDpi()The minimum resolution in DPI used for OCR (Getter)PageOptionsgetPageOptions()The options for page processing (Getter)booleangetProcessEmbeddedFiles()Whether to process embedded files recursively (Getter)TextOptionsgetTextOptions()The options for text processing (Getter)voidsetDpi(double value)The default resolution in DPI used for OCR (Setter)voidsetMaxDpi(double value)The maximum resolution in DPI used for OCR (Setter)voidsetMinDpi(double value)The minimum resolution in DPI used for OCR (Setter)voidsetProcessEmbeddedFiles(boolean value)Whether to process embedded files recursively (Setter)-
Methods inherited from class com.pdftools.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
getDpi
public double getDpi()
The default resolution in DPI used for OCR (Getter)
Each page's optimal OCR resolution is determined automatically, such that all images and text can be recognized. The default resolution is chosen if it is within the range of optimal resolutions.
The range should be within the resolutions supported by the OCR engine. Most OCR engines are optimized for resolutions around 300 DPI.
Default value: 300.0
-
setDpi
public void setDpi(double value)
The default resolution in DPI used for OCR (Setter)
Each page's optimal OCR resolution is determined automatically, such that all images and text can be recognized. The default resolution is chosen if it is within the range of optimal resolutions.
The range should be within the resolutions supported by the OCR engine. Most OCR engines are optimized for resolutions around 300 DPI.
Default value: 300.0
- Throws:
java.lang.IllegalArgumentException- The DPI value is invalid.
-
getMinDpi
public double getMinDpi()
The minimum resolution in DPI used for OCR (Getter)
Default value: 200.0
-
setMinDpi
public void setMinDpi(double value)
The minimum resolution in DPI used for OCR (Setter)
Default value: 200.0- Throws:
java.lang.IllegalArgumentException- The minimum DPI value is invalid.
-
getMaxDpi
public double getMaxDpi()
The maximum resolution in DPI used for OCR (Getter)
Default value: 400.0
-
setMaxDpi
public void setMaxDpi(double value)
The maximum resolution in DPI used for OCR (Setter)
Default value: 400.0- Throws:
java.lang.IllegalArgumentException- The maximum DPI value is invalid.
-
getProcessEmbeddedFiles
public boolean getProcessEmbeddedFiles()
Whether to process embedded files recursively (Getter)
If enabled, embedded PDF files are also processed with OCR. The default is to copy all embedded files as-is.
Default value:
false
-
setProcessEmbeddedFiles
public void setProcessEmbeddedFiles(boolean value)
Whether to process embedded files recursively (Setter)
If enabled, embedded PDF files are also processed with OCR. The default is to copy all embedded files as-is.
Default value:
false
-
getImageOptions
public ImageOptions getImageOptions()
The options for image processing (Getter)
Options controlling how images in the PDF are processed during OCR.
-
getTextOptions
public TextOptions getTextOptions()
The options for text processing (Getter)
Options controlling how existing text is processed during OCR.
-
getPageOptions
public PageOptions getPageOptions()
The options for page processing (Getter)
Options controlling page-level OCR processing and tagging.
-
-