pdfOCR 4.0.0 API
iText.Pdfocr.OcrPdfCreator Class Reference

OcrPdfCreator is the class that creates PDF documents containing input images and text that was recognized using provided IOcrEngine. More...

Public Member Functions

  OcrPdfCreator (IOcrEngine ocrEngine)
  Creates a new OcrPdfCreator instance. More...
 
  OcrPdfCreator (IOcrEngine ocrEngine, OcrPdfCreatorProperties ocrPdfCreatorProperties)
  Creates a new OcrPdfCreator instance. More...
 
OcrPdfCreatorProperties  GetOcrPdfCreatorProperties ()
  Gets properties for OcrPdfCreator. More...
 
void  SetOcrPdfCreatorProperties (OcrPdfCreatorProperties ocrPdfCreatorProperties)
  Sets properties for OcrPdfCreator. More...
 
PdfDocument  CreatePdfA (IList< FileInfo > inputImages, PdfWriter pdfWriter, DocumentProperties documentProperties, PdfOutputIntent pdfOutputIntent, IOcrProcessProperties ocrProcessProperties)
  Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter , iText.Kernel.Pdf.DocumentProperties and iText.Kernel.Pdf.PdfOutputIntent. More...
 
PdfDocument  CreatePdfA (IList< FileInfo > inputImages, PdfWriter pdfWriter, PdfOutputIntent pdfOutputIntent)
  Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter and iText.Kernel.Pdf.PdfOutputIntent. More...
 
PdfDocument  CreatePdfA (IList< FileInfo > inputImages, PdfWriter pdfWriter, DocumentProperties documentProperties, PdfOutputIntent pdfOutputIntent)
  Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter , iText.Kernel.Pdf.DocumentProperties and iText.Kernel.Pdf.PdfOutputIntent. More...
 
PdfDocument  CreatePdf (IList< FileInfo > inputImages, PdfWriter pdfWriter, DocumentProperties documentProperties, IOcrProcessProperties ocrProcessProperties)
  Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter. More...
 
PdfDocument  CreatePdf (IList< FileInfo > inputImages, PdfWriter pdfWriter, DocumentProperties documentProperties)
  Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter. More...
 
PdfDocument  CreatePdf (IList< FileInfo > inputImages, PdfWriter pdfWriter)
  Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter. More...
 
virtual void  CreatePdfFile (IList< FileInfo > inputImages, FileInfo outPdfFile)
  Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided System.IO.FileInfo. More...
 
virtual void  CreatePdfAFile (IList< FileInfo > inputImages, FileInfo outPdfFile, PdfOutputIntent pdfOutputIntent)
  Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided System.IO.FileInfo and iText.Kernel.Pdf.PdfOutputIntent. More...
 
IOcrEngine  GetOcrEngine ()
  Gets used IOcrEngine. More...
 
void  SetOcrEngine (IOcrEngine reader)
  Sets IOcrEngine reader object to perform OCR. More...
 

Detailed Description

OcrPdfCreator is the class that creates PDF documents containing input images and text that was recognized using provided IOcrEngine.

OcrPdfCreator is the class that creates PDF documents containing input images and text that was recognized using provided IOcrEngine. OcrPdfCreator provides possibilities to set list of input images to be used for OCR, to set scaling mode for images, to set color of text in output PDF document, to set fixed size of the PDF document's page and to perform OCR using given images and to return iText.Kernel.Pdf.PdfDocument as result. OCR is based on the provided IOcrEngine (e.g. tesseract reader). This parameter is obligatory and it should be provided in constructor or using setter.

Constructor & Destructor Documentation

◆ OcrPdfCreator() [1/2]

iText.Pdfocr.OcrPdfCreator.OcrPdfCreator ( IOcrEngine  ocrEngine )
inline

Creates a new OcrPdfCreator instance.

Parameters
ocrEngine

IOcrEngine selected OCR Reader

◆ OcrPdfCreator() [2/2]

iText.Pdfocr.OcrPdfCreator.OcrPdfCreator ( IOcrEngine  ocrEngine,
OcrPdfCreatorProperties  ocrPdfCreatorProperties 
)
inline

Creates a new OcrPdfCreator instance.

Parameters
ocrEngine selected OCR Reader IOcrEngine
ocrPdfCreatorProperties set of properties for OcrPdfCreator

Member Function Documentation

◆ CreatePdf() [1/3]

PdfDocument iText.Pdfocr.OcrPdfCreator.CreatePdf ( IList< FileInfo >  inputImages,
PdfWriter  pdfWriter 
)
inline

Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter.

Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter.

NOTE that after executing this method you will have a product event from the both itextcore and pdfOcr. Therefore, use this method only if you need to work with the generated iText.Kernel.Pdf.PdfDocument . If you don't need this, use the CreatePdfFile(System.Collections.Generic.IList, System.IO.FileInfo) method. In this case, only the pdfOcr event will be dispatched.

Parameters
inputImages

System.Collections.IList of images to be OCRed

Parameters
pdfWriter the iText.Kernel.Pdf.PdfWriter object to write final PDF document to
Returns
result iText.Kernel.Pdf.PdfDocument object

◆ CreatePdf() [2/3]

PdfDocument iText.Pdfocr.OcrPdfCreator.CreatePdf ( IList< FileInfo >  inputImages,
PdfWriter  pdfWriter,
DocumentProperties  documentProperties 
)
inline

Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter.

Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter.

NOTE that after executing this method you will have a product event from the both itextcore and pdfOcr. Therefore, use this method only if you need to work with the generated iText.Kernel.Pdf.PdfDocument . If you don't need this, use the CreatePdfFile(System.Collections.Generic.IList, System.IO.FileInfo) method. In this case, only the pdfOcr event will be dispatched.

Parameters
inputImages

System.Collections.IList of images to be OCRed

Parameters
pdfWriter the iText.Kernel.Pdf.PdfWriter object to write final PDF document to
documentProperties document properties
Returns
result iText.Kernel.Pdf.PdfDocument object

◆ CreatePdf() [3/3]

PdfDocument iText.Pdfocr.OcrPdfCreator.CreatePdf ( IList< FileInfo >  inputImages,
PdfWriter  pdfWriter,
DocumentProperties  documentProperties,
IOcrProcessProperties  ocrProcessProperties 
)
inline

Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter.

Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter.

NOTE that after executing this method you will have a product event from the both itextcore and pdfOcr. Therefore, use this method only if you need to work with the generated iText.Kernel.Pdf.PdfDocument . If you don't need this, use the CreatePdfFile(System.Collections.Generic.IList, System.IO.FileInfo) method. In this case, only the pdfOcr event will be dispatched.

Parameters
inputImages

System.Collections.IList of images to be OCRed

Parameters
pdfWriter the iText.Kernel.Pdf.PdfWriter object to write final PDF document to
documentProperties document properties
ocrProcessProperties extra OCR process properties passed to OcrProcessContext
Returns
result iText.Kernel.Pdf.PdfDocument object

◆ CreatePdfA() [1/3]

PdfDocument iText.Pdfocr.OcrPdfCreator.CreatePdfA ( IList< FileInfo >  inputImages,
PdfWriter  pdfWriter,
DocumentProperties  documentProperties,
PdfOutputIntent  pdfOutputIntent 
)
inline

Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter , iText.Kernel.Pdf.DocumentProperties and iText.Kernel.Pdf.PdfOutputIntent.

Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter , iText.Kernel.Pdf.DocumentProperties and iText.Kernel.Pdf.PdfOutputIntent . PDF/A-3u document will be created if provided iText.Kernel.Pdf.PdfOutputIntent is not null.

NOTE that after executing this method you will have a product event from the both itextcore and pdfOcr. Therefore, use this method only if you need to work with the generated iText.Kernel.Pdf.PdfDocument . If you don't need this, use the CreatePdfAFile(System.Collections.Generic.IList, System.IO.FileInfo, iText.Kernel.Pdf.PdfOutputIntent) method. In this case, only the pdfOcr event will be dispatched.

Parameters
inputImages

System.Collections.IList of images to be OCRed

Parameters
pdfWriter the iText.Kernel.Pdf.PdfWriter object to write final PDF document to
documentProperties document properties
pdfOutputIntent

iText.Kernel.Pdf.PdfOutputIntent for PDF/A-3u document

Returns
result PDF/A-3u iText.Kernel.Pdf.PdfDocument object

◆ CreatePdfA() [2/3]

PdfDocument iText.Pdfocr.OcrPdfCreator.CreatePdfA ( IList< FileInfo >  inputImages,
PdfWriter  pdfWriter,
DocumentProperties  documentProperties,
PdfOutputIntent  pdfOutputIntent,
IOcrProcessProperties  ocrProcessProperties 
)
inline

Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter , iText.Kernel.Pdf.DocumentProperties and iText.Kernel.Pdf.PdfOutputIntent.

Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter , iText.Kernel.Pdf.DocumentProperties and iText.Kernel.Pdf.PdfOutputIntent . PDF/A-3u document will be created if provided iText.Kernel.Pdf.PdfOutputIntent is not null.

NOTE that after executing this method you will have a product event from the both itextcore and pdfOcr. Therefore, use this method only if you need to work with the generated iText.Kernel.Pdf.PdfDocument . If you don't need this, use the CreatePdfAFile(System.Collections.Generic.IList, System.IO.FileInfo, iText.Kernel.Pdf.PdfOutputIntent) method. In this case, only the pdfOcr event will be dispatched.

Parameters
inputImages

System.Collections.IList of images to be OCRed

Parameters
pdfWriter the iText.Kernel.Pdf.PdfWriter object to write final PDF document to
documentProperties document properties
pdfOutputIntent

iText.Kernel.Pdf.PdfOutputIntent for PDF/A-3u document

Parameters
ocrProcessProperties extra OCR process properties passed to OcrProcessContext
Returns
result PDF/A-3u iText.Kernel.Pdf.PdfDocument object

◆ CreatePdfA() [3/3]

PdfDocument iText.Pdfocr.OcrPdfCreator.CreatePdfA ( IList< FileInfo >  inputImages,
PdfWriter  pdfWriter,
PdfOutputIntent  pdfOutputIntent 
)
inline

Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter and iText.Kernel.Pdf.PdfOutputIntent.

Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided iText.Kernel.Pdf.PdfWriter and iText.Kernel.Pdf.PdfOutputIntent . PDF/A-3u document will be created if provided iText.Kernel.Pdf.PdfOutputIntent is not null.

NOTE that after executing this method you will have a product event from the both itextcore and pdfOcr. Therefore, use this method only if you need to work with the generated iText.Kernel.Pdf.PdfDocument . If you don't need this, use the CreatePdfAFile(System.Collections.Generic.IList, System.IO.FileInfo, iText.Kernel.Pdf.PdfOutputIntent) method. In this case, only the pdfOcr event will be dispatched.

Parameters
inputImages

System.Collections.IList of images to be OCRed

Parameters
pdfWriter the iText.Kernel.Pdf.PdfWriter object to write final PDF document to
pdfOutputIntent

iText.Kernel.Pdf.PdfOutputIntent for PDF/A-3u document

Returns
result PDF/A-3u iText.Kernel.Pdf.PdfDocument object

◆ CreatePdfAFile()

virtual void iText.Pdfocr.OcrPdfCreator.CreatePdfAFile ( IList< FileInfo >  inputImages,
FileInfo  outPdfFile,
PdfOutputIntent  pdfOutputIntent 
)
inlinevirtual

Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided System.IO.FileInfo and iText.Kernel.Pdf.PdfOutputIntent.

Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided System.IO.FileInfo and iText.Kernel.Pdf.PdfOutputIntent. PDF/A-3u document will be created if provided iText.Kernel.Pdf.PdfOutputIntent is not null.

Parameters
inputImages

System.Collections.IList of images to be OCRed

Parameters
outPdfFile the System.IO.FileInfo object to write final PDF document to
pdfOutputIntent

iText.Kernel.Pdf.PdfOutputIntent for PDF/A-3u document

◆ CreatePdfFile()

virtual void iText.Pdfocr.OcrPdfCreator.CreatePdfFile ( IList< FileInfo >  inputImages,
FileInfo  outPdfFile 
)
inlinevirtual

Performs OCR with set parameters using provided IOcrEngine and creates PDF using provided System.IO.FileInfo.

Parameters
inputImages

System.Collections.IList of images to be OCRed

Parameters
outPdfFile the System.IO.FileInfo object to write final PDF document to

◆ GetOcrEngine()

IOcrEngine iText.Pdfocr.OcrPdfCreator.GetOcrEngine ( )
inline

Gets used IOcrEngine.

Gets used IOcrEngine. Returns IOcrEngine reader object to perform OCR.

Returns
selected IOcrEngine instance

◆ GetOcrPdfCreatorProperties()

OcrPdfCreatorProperties iText.Pdfocr.OcrPdfCreator.GetOcrPdfCreatorProperties ( )
inline

Gets properties for OcrPdfCreator.

Returns
set properties OcrPdfCreatorProperties

◆ SetOcrEngine()

void iText.Pdfocr.OcrPdfCreator.SetOcrEngine ( IOcrEngine  reader )
inline

Sets IOcrEngine reader object to perform OCR.

Parameters
reader selected IOcrEngine instance

◆ SetOcrPdfCreatorProperties()

void iText.Pdfocr.OcrPdfCreator.SetOcrPdfCreatorProperties ( OcrPdfCreatorProperties  ocrPdfCreatorProperties )
inline

Sets properties for OcrPdfCreator.

Parameters
ocrPdfCreatorProperties set of properties OcrPdfCreatorProperties for OcrPdfCreator