public class

OCRModule

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.OCRModule

Class Overview

The class OCRModule. static interface to PDFTron SDKs OCR functionality

Summary

Public Methods
static void applyOCRJsonToPDF(PDFDoc dst, String json)
Add hidden text layer to a PDF consisting of raster image(s).
static void applyOCRXmlToPDF(PDFDoc dst, String xml)
Add hidden text layer to a PDF consisting of raster image(s).
static String getOCRJsonFromImage(PDFDoc dst, String src, OCROptions options)
Perform OCR on an image and return resulting JSON string.
static String getOCRJsonFromPDF(PDFDoc src, OCROptions options)
Perform OCR on raster images within a PDF and return resulting JSON string.
static String getOCRXmlFromImage(PDFDoc dst, String src, OCROptions options)
Perform OCR on an image and return resulting XML string.
static String getOCRXmlFromPDF(PDFDoc src, OCROptions options)
Perform OCR on raster images within a PDF and return resulting XML string.
static void imageToPDF(PDFDoc dst, String src, OCROptions options)
Convert an image to a PDF with searchable text.
static boolean isModuleAvailable()
Find out whether the OCR module is available (and licensed).
static void processPDF(PDFDoc dst, OCROptions options)
Add searchable and selectable text to raster images within a PDF.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static void applyOCRJsonToPDF (PDFDoc dst, String json)

Add hidden text layer to a PDF consisting of raster image(s).

Parameters
dst -- The source and destination document
json -- JSON representing OCR results

public static void applyOCRXmlToPDF (PDFDoc dst, String xml)

Add hidden text layer to a PDF consisting of raster image(s).

Parameters
dst -- The source and destination document
xml -- XML representing OCR results

public static String getOCRJsonFromImage (PDFDoc dst, String src, OCROptions 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
dst -- The destination document
src -- The path to the input image
options -- OCR options (optional)
Returns
  • JSON string represeting OCR results

public static String getOCRJsonFromPDF (PDFDoc src, OCROptions options)

Perform OCR on raster images within a PDF and return resulting JSON string.

Parameters
src -- The source document
options -- OCR options (optional)
Returns
  • JSON string represeting OCR results

public static String getOCRXmlFromImage (PDFDoc dst, String src, OCROptions 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
dst -- The destination document
src -- The path to the input image
options -- OCR options (optional)
Returns
  • XML string represeting OCR results

public static String getOCRXmlFromPDF (PDFDoc src, OCROptions options)

Perform OCR on raster images within a PDF and return resulting XML string.

Parameters
src -- The source document
options -- OCR options (optional)
Returns
  • XML string represeting OCR results

public static void imageToPDF (PDFDoc dst, String src, OCROptions options)

Convert an image to a PDF with searchable text.

Parameters
dst -- The destination document
src -- The path to the input image
options -- OCR options (optional)

public static boolean isModuleAvailable ()

Find out whether the OCR module is available (and licensed).

Returns
  • returns true if OCR operations can be performed

public static void processPDF (PDFDoc dst, OCROptions options)

Add searchable and selectable text to raster images within a PDF.

Parameters
dst -- The source and destination document
options -- OCR options (optional)