Class: OCRModule

Core.PDFNet. OCRModule


new OCRModule()

The class OCRModule. static interface to PDFTron SDKs OCR functionality

Methods


<static> applyOCRJsonToPDF(dst, json)

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

<static> pageNeedsOCR(page, accept_invisible_text)

Find out whether the page needs OCR for data extraction.
Parameters:
Name Type Description
page Core.PDFNet.Page - The page to be analyzed.
accept_invisible_text boolean - If set, then the presence of invisible text is accounted for.
Returns:
A promise that resolves to returns true if the page needs OCR.
Type
Promise.<boolean>