Class OCRModule
static interface to PDFTron SDKs OCR functionality
Inherited Members
Namespace: pdftron.PDF
Assembly: PDFTronDotNet.dll
Syntax
public static class OCRModule
Methods
ApplyOCRJsonToPDF(PDFDoc, string)
Add hidden text layer to a PDF consisting of raster image(s).
Declaration
public static void ApplyOCRJsonToPDF(PDFDoc dst, string json)
Parameters
Type | Name | Description |
---|---|---|
PDFDoc | dst | The source and destination document |
string | json | JSON representing OCR results |
ApplyOCRXmlToPDF(PDFDoc, string)
Add hidden text layer to a PDF consisting of raster image(s).
Declaration
public static void ApplyOCRXmlToPDF(PDFDoc dst, string xml)
Parameters
Type | Name | Description |
---|---|---|
PDFDoc | dst | The source and destination document |
string | xml | XML representing OCR results |
GetOCRJsonFromImage(PDFDoc, string, OCROptions)
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
Declaration
public static string GetOCRJsonFromImage(PDFDoc dst, string src, OCROptions options)
Parameters
Type | Name | Description |
---|---|---|
PDFDoc | dst | The destination document |
string | src | The path to the input image |
OCROptions | options | OCR options (optional) |
Returns
Type | Description |
---|---|
string | JSON string representing OCR results |
GetOCRJsonFromPDF(PDFDoc, OCROptions)
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
Declaration
public static string GetOCRJsonFromPDF(PDFDoc src, OCROptions options)
Parameters
Type | Name | Description |
---|---|---|
PDFDoc | src | The source document |
OCROptions | options | OCR options (optional) |
Returns
Type | Description |
---|---|
string | JSON string representing OCR results |
GetOCRXmlFromImage(PDFDoc, string, OCROptions)
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
Declaration
public static string GetOCRXmlFromImage(PDFDoc dst, string src, OCROptions options)
Parameters
Type | Name | Description |
---|---|---|
PDFDoc | dst | The destination document |
string | src | The path to the input image |
OCROptions | options | OCR options (optional) |
Returns
Type | Description |
---|---|
string | XML string representing OCR results |
GetOCRXmlFromPDF(PDFDoc, OCROptions)
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
Declaration
public static string GetOCRXmlFromPDF(PDFDoc src, OCROptions options)
Parameters
Type | Name | Description |
---|---|---|
PDFDoc | src | The source document |
OCROptions | options | OCR options (optional) |
Returns
Type | Description |
---|---|
string | XML string representing OCR results |
ImageToPDF(PDFDoc, string, OCROptions)
Convert an image to a PDF with searchable text.
Declaration
public static void ImageToPDF(PDFDoc dst, string src, OCROptions options)
Parameters
Type | Name | Description |
---|---|---|
PDFDoc | dst | The destination document |
string | src | The path to the input image |
OCROptions | options | OCR options (optional) |
IsIRISModuleAvailable()
Find out whether the IRIS OCR module is available.
Declaration
public static bool IsIRISModuleAvailable()
Returns
Type | Description |
---|---|
bool | returns true if the IRIS OCR module has been located |
IsModuleAvailable()
Find out whether the OCR module is available.
Declaration
public static bool IsModuleAvailable()
Returns
Type | Description |
---|---|
bool | returns true if OCR operations can be performed |
ProcessPDF(PDFDoc, OCROptions)
Add searchable and selectable text to a PDF.
Declaration
public static void ProcessPDF(PDFDoc dst, OCROptions options)
Parameters
Type | Name | Description |
---|---|---|
PDFDoc | dst | The source and destination document |
OCROptions | options | OCR options (optional) |