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 dstCore.PDFNet.PDFDoc | Core.PDFNet.SDFDoc | Core.PDFNet.FDFDoc - The source and destination document. jsonstring - 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 dstCore.PDFNet.PDFDoc | Core.PDFNet.SDFDoc | Core.PDFNet.FDFDoc - The source and destination document. xmlstring - 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 pageCore.PDFNet.Page - The page to be analyzed. accept_invisible_textboolean - 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>