Class: OCRModule

PDFNet. OCRModule


new OCRModule()

The class OCRModule. static interface to PDFTron SDKs OCR functionality

Classes

OCROptions

Methods


<static> applyOCRJsonToPDF(dst, json)

Add hidden text layer to a PDF consisting of raster image(s).
Parameters:
Name Type Description
dst PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc - The source and destination document.
json string - JSON representing OCR results.
Returns:
Type
Promise.<void>

<static> applyOCRXmlToPDF(dst, xml)

Add hidden text layer to a PDF consisting of raster image(s).
Parameters:
Name Type Description
dst PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc - The source and destination document.
xml string - XML representing OCR results.
Returns:
Type
Promise.<void>

<static> createOCROptions()

Method to create an OCROptions object
Returns:
A promise that resolves to a PDFNet.OCRModule.OCROptions.
Type
Promise.<PDFNet.OCRModule.OCROptions>

<static> getOCRJsonFromImage(dst, src [, options])

Perform OCR on an image and return resulting JSON string. Side effect: source image is converted to PDF and stored in the destination document. The box is a summary for a text fragment bounding box (leftmost x, bottommost y, width, height) The box coordinates are in units of points (1/72 of an inch), with the origin at the top left, and larger x and y coordinates representing further right and down, respectively
Parameters:
Name Type Argument Description
dst PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc - The destination document.
src string - The path to the input image.
options PDFNet.Obj | PDFNet.OCRModule.OCROptions <optional>
- OCR options (optional).
Returns:
A promise that resolves to jSON string representing OCR results.
Type
Promise.<string>

<static> getOCRJsonFromPDF(src [, options])

Perform OCR on raster images within a PDF and return resulting JSON string. The box is a summary for a text fragment bounding box (leftmost x, bottommost y, width, height) The box coordinates are in units of points (1/72 of an inch), with the origin at the top left, and larger x and y coordinates representing further right and down, respectively
Parameters:
Name Type Argument Description
src PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc - The source document.
options PDFNet.Obj | PDFNet.OCRModule.OCROptions <optional>
- OCR options (optional).
Returns:
A promise that resolves to jSON string representing OCR results.
Type
Promise.<string>

<static> getOCRXmlFromImage(dst, src [, options])

Perform OCR on an image and return resulting XML string. Side effect: source image is converted to PDF and stored in the destination document. The box is a summary for a text fragment bounding box (leftmost x, bottommost y, width, height) The box coordinates are in units of points (1/72 of an inch), with the origin at the top left, and larger x and y coordinates representing further right and down, respectively
Parameters:
Name Type Argument Description
dst PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc - The destination document.
src string - The path to the input image.
options PDFNet.Obj | PDFNet.OCRModule.OCROptions <optional>
- OCR options (optional).
Returns:
A promise that resolves to xML string representing OCR results.
Type
Promise.<string>

<static> getOCRXmlFromPDF(src [, options])

Perform OCR on raster images within a PDF and return resulting XML string. The box is a summary for a text fragment bounding box (leftmost x, bottommost y, width, height) The box coordinates are in units of points (1/72 of an inch), with the origin at the top left, and larger x and y coordinates representing further right and down, respectively
Parameters:
Name Type Argument Description
src PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc - The source document.
options PDFNet.Obj | PDFNet.OCRModule.OCROptions <optional>
- OCR options (optional).
Returns:
A promise that resolves to xML string representing OCR results.
Type
Promise.<string>

<static> imageToPDF(dst, src [, options])

Convert an image to a PDF with searchable text.
Parameters:
Name Type Argument Description
dst PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc - The destination document.
src string - The path to the input image.
options PDFNet.Obj | PDFNet.OCRModule.OCROptions <optional>
- OCR options (optional).
Returns:
Type
Promise.<void>

<static> isIRISModuleAvailable()

Find out whether the IRIS OCR module is available.
Returns:
A promise that resolves to returns true if the IRIS ocr module has been located.
Type
Promise.<boolean>

<static> isModuleAvailable()

Find out whether the OCR module is available (and licensed).
Returns:
A promise that resolves to returns true if OCR operations can be performed.
Type
Promise.<boolean>

<static> processPDF(dst [, options])

Add searchable and selectable text to raster images within a PDF.
Parameters:
Name Type Argument Description
dst PDFNet.PDFDoc | PDFNet.SDFDoc | PDFNet.FDFDoc - The source and destination document.
options PDFNet.Obj | PDFNet.OCRModule.OCROptions <optional>
- OCR options (optional).
Returns:
Type
Promise.<void>