Return >  Addon.OCR.SetOutputFormat

Addon.OCR.SetOutputFormat()

Description

Sets the OCR result format. Determines whether the OCR output is in text or PDF format.

Syntax

.Addon.OCR.SetOutputFormat(OCRResultFormat);

Parameters

<int> OCRResultFormat: Specifies the OCR result format.

Allowed Values EnumDWT_OCROutputFormat enumeration Description
0 EnumDWT_OCROutputFormat.OCROF_TEXT Outputs in a plain text format with a .txt extension if saved as a file.
1 EnumDWT_OCROutputFormat.OCROF_PDFPLAINTEXT Outputs the OCR text results to a PDF. Any images from the original scanned image are lost.
2 EnumDWT_OCROutputFormat.OCROF_PDFIMAGEOVERTEXT Outputs the OCR text results to a PDF, with the original scanned image printed overtop.
3 EnumDWT_OCROutputFormat.OCROF_PDFPLAINTEXT_PDFX Outputs the OCR text results to a PDF/A. Any images from the original scanned image are lost.
4 EnumDWT_OCROutputFormat.OCROF_PDFIMAGEOVERTEXT_PDFX Outputs the OCR text results to a PDF/A, with the original scanned image printed overtop.

Remarks

By default the value is 2, indicating an Image over Text PDF.
If you set the mode to EnumDWT_OCROutputFormat.OCROF_PDFIMAGEOVERTEXT, this results in a PDF with the same look as the original image, but the text is selectable and searchable.

Example

DWObject.Addon.OCR.SetOutputFormat(EnumDWT_OCROutputFormat.OCROF_PDFPLAINTEXT);

See also

result.GetFormat
Addon.OCR.Recognize
Addon.OCR.SetIfUseDetectedFont