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 isIRISModuleAvailable()
Find out whether the IRIS OCR module is available.
static boolean isModuleAvailable()
Find out whether the OCR module is available.
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. 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
dst -- The destination document
src -- The path to the input image
options -- OCR options (optional)
Returns
  • JSON string representing OCR results

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

public static String getOCRXmlFromPDF (PDFDoc src, OCROptions 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
src -- The source document
options -- OCR options (optional)
Returns
  • XML string representing 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 isIRISModuleAvailable ()

Find out whether the IRIS OCR module is available.

Returns
  • returns true if the IRIS OCR module has been found

public static boolean isModuleAvailable ()

Find out whether the OCR module is available.

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)