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.
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 represeting OCR results.
Type
Promise.<string>

<static> getOCRJsonFromPDF(src [, options])

Perform OCR on raster images within a PDF and return resulting JSON string.
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 represeting 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.
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 represeting OCR results.
Type
Promise.<string>

<static> getOCRXmlFromPDF(src [, options])

Perform OCR on raster images within a PDF and return resulting XML string.
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 represeting 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> 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>