public class OcrPdfCreator extends Object
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
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 and Description |
|---|
OcrPdfCreator(IOcrEngine ocrEngine)
Creates a new
OcrPdfCreator instance. |
OcrPdfCreator(IOcrEngine ocrEngine,
OcrPdfCreatorProperties ocrPdfCreatorProperties)
Creates a new
OcrPdfCreator instance. |
| Modifier and Type | Method and Description |
|---|---|
com.itextpdf.kernel.pdf.PdfDocument |
createPdf(List<File> inputImages,
com.itextpdf.kernel.pdf.PdfWriter pdfWriter)
Performs OCR with set parameters using provided
IOcrEngine and
creates PDF using provided PdfWriter. |
com.itextpdf.kernel.pdf.PdfDocument |
createPdf(List<File> inputImages,
com.itextpdf.kernel.pdf.PdfWriter pdfWriter,
com.itextpdf.kernel.pdf.DocumentProperties documentProperties)
Performs OCR with set parameters using provided
IOcrEngine and
creates PDF using provided PdfWriter. |
com.itextpdf.kernel.pdf.PdfDocument |
createPdf(List<File> inputImages,
com.itextpdf.kernel.pdf.PdfWriter pdfWriter,
com.itextpdf.kernel.pdf.DocumentProperties documentProperties,
IOcrProcessProperties ocrProcessProperties)
Performs OCR with set parameters using provided
IOcrEngine and
creates PDF using provided PdfWriter. |
com.itextpdf.kernel.pdf.PdfDocument |
createPdfA(List<File> inputImages,
com.itextpdf.kernel.pdf.PdfWriter pdfWriter,
com.itextpdf.kernel.pdf.DocumentProperties documentProperties,
com.itextpdf.kernel.pdf.PdfOutputIntent pdfOutputIntent)
Performs OCR with set parameters using provided
IOcrEngine and
creates PDF using provided PdfWriter, DocumentProperties
and PdfOutputIntent. |
com.itextpdf.kernel.pdf.PdfDocument |
createPdfA(List<File> inputImages,
com.itextpdf.kernel.pdf.PdfWriter pdfWriter,
com.itextpdf.kernel.pdf.DocumentProperties documentProperties,
com.itextpdf.kernel.pdf.PdfOutputIntent pdfOutputIntent,
IOcrProcessProperties ocrProcessProperties)
Performs OCR with set parameters using provided
IOcrEngine and
creates PDF using provided PdfWriter, DocumentProperties
and PdfOutputIntent. |
com.itextpdf.kernel.pdf.PdfDocument |
createPdfA(List<File> inputImages,
com.itextpdf.kernel.pdf.PdfWriter pdfWriter,
com.itextpdf.kernel.pdf.PdfOutputIntent pdfOutputIntent)
Performs OCR with set parameters using provided
IOcrEngine and
creates PDF using provided PdfWriter and
PdfOutputIntent. |
void |
createPdfAFile(List<File> inputImages,
File outPdfFile,
com.itextpdf.kernel.pdf.PdfOutputIntent pdfOutputIntent)
Performs OCR with set parameters using provided
IOcrEngine and
creates PDF using provided File and PdfOutputIntent. |
void |
createPdfFile(List<File> inputImages,
File outPdfFile)
Performs OCR with set parameters using provided
IOcrEngine and
creates PDF using provided File. |
IOcrEngine |
getOcrEngine()
Gets used
IOcrEngine. |
OcrPdfCreatorProperties |
getOcrPdfCreatorProperties()
Gets properties for
OcrPdfCreator. |
void |
setOcrEngine(IOcrEngine reader)
Sets
IOcrEngine reader object to perform OCR. |
void |
setOcrPdfCreatorProperties(OcrPdfCreatorProperties ocrPdfCreatorProperties)
Sets properties for
OcrPdfCreator. |
public OcrPdfCreator(IOcrEngine ocrEngine)
OcrPdfCreator instance.ocrEngine - IOcrEngine selected OCR Readerpublic OcrPdfCreator(IOcrEngine ocrEngine, OcrPdfCreatorProperties ocrPdfCreatorProperties)
OcrPdfCreator instance.ocrEngine - selected OCR Reader IOcrEngineocrPdfCreatorProperties - set of properties for OcrPdfCreatorpublic final OcrPdfCreatorProperties getOcrPdfCreatorProperties()
OcrPdfCreator.OcrPdfCreatorPropertiespublic final void setOcrPdfCreatorProperties(OcrPdfCreatorProperties ocrPdfCreatorProperties)
OcrPdfCreator.ocrPdfCreatorProperties - set of properties
OcrPdfCreatorProperties for OcrPdfCreatorpublic final com.itextpdf.kernel.pdf.PdfDocument createPdfA(List<File> inputImages, com.itextpdf.kernel.pdf.PdfWriter pdfWriter, com.itextpdf.kernel.pdf.DocumentProperties documentProperties, com.itextpdf.kernel.pdf.PdfOutputIntent pdfOutputIntent, IOcrProcessProperties ocrProcessProperties) throws PdfOcrException
IOcrEngine and
creates PDF using provided PdfWriter, DocumentProperties
and PdfOutputIntent. PDF/A-3u document will be created if
provided 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 PdfDocument. If you don't need this, use the
createPdfAFile(java.util.List<java.io.File>, java.io.File, com.itextpdf.kernel.pdf.PdfOutputIntent) method. In this case, only the pdfOcr event will be dispatched.
inputImages - List of images to be OCRedpdfWriter - the PdfWriter object
to write final PDF document todocumentProperties - document propertiespdfOutputIntent - PdfOutputIntent
for PDF/A-3u documentocrProcessProperties - extra OCR process properties passed to OcrProcessContextPdfDocument
objectPdfOcrException - if it was not possible to read provided or
default fontpublic final com.itextpdf.kernel.pdf.PdfDocument createPdfA(List<File> inputImages, com.itextpdf.kernel.pdf.PdfWriter pdfWriter, com.itextpdf.kernel.pdf.PdfOutputIntent pdfOutputIntent) throws PdfOcrException
IOcrEngine and
creates PDF using provided PdfWriter and
PdfOutputIntent. PDF/A-3u document will be created if
provided 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 PdfDocument. If you don't need this, use the
createPdfAFile(java.util.List<java.io.File>, java.io.File, com.itextpdf.kernel.pdf.PdfOutputIntent) method. In this case, only the pdfOcr event will be dispatched.
inputImages - List of images to be OCRedpdfWriter - the PdfWriter object
to write final PDF document topdfOutputIntent - PdfOutputIntent
for PDF/A-3u documentPdfDocument
objectPdfOcrException - if it was not possible to read provided or
default fontpublic final com.itextpdf.kernel.pdf.PdfDocument createPdfA(List<File> inputImages, com.itextpdf.kernel.pdf.PdfWriter pdfWriter, com.itextpdf.kernel.pdf.DocumentProperties documentProperties, com.itextpdf.kernel.pdf.PdfOutputIntent pdfOutputIntent) throws PdfOcrException
IOcrEngine and
creates PDF using provided PdfWriter, DocumentProperties
and PdfOutputIntent. PDF/A-3u document will be created if
provided 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 PdfDocument. If you don't need this, use the
createPdfAFile(java.util.List<java.io.File>, java.io.File, com.itextpdf.kernel.pdf.PdfOutputIntent) method. In this case, only the pdfOcr event will be dispatched.
inputImages - List of images to be OCRedpdfWriter - the PdfWriter object
to write final PDF document todocumentProperties - document propertiespdfOutputIntent - PdfOutputIntent
for PDF/A-3u documentPdfDocument
objectPdfOcrException - if it was not possible to read provided or
default fontpublic final com.itextpdf.kernel.pdf.PdfDocument createPdf(List<File> inputImages, com.itextpdf.kernel.pdf.PdfWriter pdfWriter, com.itextpdf.kernel.pdf.DocumentProperties documentProperties, IOcrProcessProperties ocrProcessProperties) throws PdfOcrException
IOcrEngine and
creates PDF using provided 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 PdfDocument. If you don't need this, use the
createPdfFile(java.util.List<java.io.File>, java.io.File) method. In this case, only the pdfOcr event will be dispatched.
inputImages - List of images to be OCRedpdfWriter - the PdfWriter object
to write final PDF document todocumentProperties - document propertiesocrProcessProperties - extra OCR process properties passed to OcrProcessContextPdfDocument objectPdfOcrException - if provided font is incorrectpublic final com.itextpdf.kernel.pdf.PdfDocument createPdf(List<File> inputImages, com.itextpdf.kernel.pdf.PdfWriter pdfWriter, com.itextpdf.kernel.pdf.DocumentProperties documentProperties) throws PdfOcrException
IOcrEngine and
creates PDF using provided 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 PdfDocument. If you don't need this, use the
createPdfFile(java.util.List<java.io.File>, java.io.File) method. In this case, only the pdfOcr event will be dispatched.
inputImages - List of images to be OCRedpdfWriter - the PdfWriter object
to write final PDF document todocumentProperties - document propertiesPdfDocument objectPdfOcrException - if provided font is incorrectpublic final com.itextpdf.kernel.pdf.PdfDocument createPdf(List<File> inputImages, com.itextpdf.kernel.pdf.PdfWriter pdfWriter) throws PdfOcrException
IOcrEngine and
creates PDF using provided 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 PdfDocument. If you don't need this, use the
createPdfFile(java.util.List<java.io.File>, java.io.File) method. In this case, only the pdfOcr event will be dispatched.
inputImages - List of images to be OCRedpdfWriter - the PdfWriter object
to write final PDF document toPdfDocument objectPdfOcrException - if provided font is incorrectpublic void createPdfFile(List<File> inputImages, File outPdfFile) throws PdfOcrException, IOException
IOcrEngine and
creates PDF using provided File.inputImages - List of images to be OCRedoutPdfFile - the File object to write final PDF document toIOException - signals that an I/O exception of some sort has occurred.PdfOcrException - if it was not possible to read provided or
default fontpublic void createPdfAFile(List<File> inputImages, File outPdfFile, com.itextpdf.kernel.pdf.PdfOutputIntent pdfOutputIntent) throws PdfOcrException, IOException
IOcrEngine and
creates PDF using provided File and PdfOutputIntent.
PDF/A-3u document will be created if provided PdfOutputIntent is not null.inputImages - List of images to be OCRedoutPdfFile - the File object to write final PDF document topdfOutputIntent - PdfOutputIntent
for PDF/A-3u documentIOException - signals that an I/O exception of some sort has occurredPdfOcrException - if it was not possible to read provided or
default fontpublic final IOcrEngine getOcrEngine()
IOcrEngine.
Returns IOcrEngine reader object to perform OCR.IOcrEngine instancepublic final void setOcrEngine(IOcrEngine reader)
IOcrEngine reader object to perform OCR.reader - selected IOcrEngine instanceCopyright © 1998–2024 Apryse Group NV. All rights reserved.