Class PdfContents
PDF input target options; determines what to OCR from within the PDF
Inheritance
Namespace: IronOcr
Assembly: IronOcr.dll
Syntax
public sealed class PdfContents : Enum
Telling IronOCR what to pull out of a PDF runs through PdfContents, passed to IronTesseract.Read when the source is a PDF document. TextAndImages reads both the embedded text layer and any rasterized images on the page, which suits a mixed PDF that contains scanned pictures alongside selectable text. OnlyImages restricts OCR to the rasterized images and skips the existing text layer, useful when a PDF already has reliable text and only its pictures need recognition. The PDF OCR example shows a PDF read end to end.
var result = ocr.Read(document, PdfContents.TextAndImages);Fields
OnlyImages
Only OCR images contained within the PDF. This is the best option for generating a searchable PDF.
Declaration
public const PdfContents OnlyImages
Field Value
| Type | Description |
|---|---|
| PdfContents |
Remarks
This option preserves bookmarks, annotations, etc.
TextAndImages
Rasterize the entire PDF and OCR the resulting image. This is the best option for retrieving ALL text from a PDF.
Declaration
public const PdfContents TextAndImages
Field Value
| Type | Description |
|---|---|
| PdfContents |
Remarks
This option creates a new PDF using the extracted text
value__
Declaration
public int value__
Field Value
| Type | Description |
|---|---|
| System.Int32 |