OcrOutput
Inheritance: java.lang.Object, java.util.AbstractCollection, java.util.AbstractList, java.util.ArrayList
public class OcrOutput extends ArrayList<RecognitionResult>
Constructors
| Constructor | Description |
|---|---|
| OcrOutput() | Initializes a new instance of the OcrOutput class with an empty collection. |
Methods
| Method | Description |
|---|---|
| add(E arg0) | |
| add(int arg0, E arg1) | |
| addAll(int arg0, Collection<? extends E> arg1) | |
| addAll(Collection<? extends E> arg0) | |
| addAll(Collection<? extends RecognitionResult> collection) | Overrides addAll to add the elements of the specified collection to the end of the OcrOutput list. |
| getTableData() | Returns structured table data extracted from all recognized pages. |
| save(OutputStream stream) | Save all recognition results to a memory stream in the specified format. |
| save(OutputStream stream, Format saveFormat) | Save all recognition results to a memory stream in the specified format. |
| save(OutputStream stream, Format saveFormat, String embeddedFontPath, PdfOptimizationMode optimizePdf) | Save all recognition results to a memory stream in the specified format. |
| save(String fullFileName) | Save all recognition result to a file. |
| save(String fullFileName, Format saveFormat) | Save all recognition result to a file. |
| save(String fullFileName, Format saveFormat, String embeddedFontPath, PdfOptimizationMode optimizePdf) | Save all recognition result to a file. |
| savePdf(OutputStream stream) | Save all recognition results into an in-memory searchable PDF document, embedding the original images as the background. |
| savePdf(OutputStream stream, String embeddedFontPath, PdfOptimizationMode optimizePdf) | Save all recognition results into an in-memory searchable PDF document, embedding the original images as the background. |
| savePdf(String fullFileName) | Save all recognition results into a searchable PDF file, with the original images set as the background. |
| savePdf(String fullFileName, String embeddedFontPath, PdfOptimizationMode optimizePdf) | Save all recognition results into a searchable PDF file, with the original images set as the background. |
OcrOutput()
public OcrOutput()
Initializes a new instance of the OcrOutput class with an empty collection. This constructor calls the base class constructor to initialize an empty list of RecognitionResult.
add(E arg0)
public boolean add(E arg0)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| arg0 | E |
Returns: boolean
add(int arg0, E arg1)
public void add(int arg0, E arg1)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| arg0 | int | |
| arg1 | E |
addAll(int arg0, Collection<? extends E> arg1)
public boolean addAll(int arg0, Collection<? extends E> arg1)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| arg0 | int | |
| arg1 | java.util.Collection<? extends E> |
Returns: boolean
addAll(Collection<? extends E> arg0)
public boolean addAll(Collection<? extends E> arg0)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| arg0 | java.util.Collection<? extends E> |
Returns: boolean
addAll(Collection<? extends RecognitionResult> collection)
public boolean addAll(Collection<? extends RecognitionResult> collection)
Overrides addAll to add the elements of the specified collection to the end of the OcrOutput list.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| collection | java.util.Collection<? extends com.aspose.ocr.RecognitionResult> | The collection of RecognitionResult to add. |
Returns: boolean - true if the collection was modified as a result of the operation.
clear()
public void clear()
getTableData()
public ArrayList<OCRTablePage> getTableData()
Returns structured table data extracted from all recognized pages. Useful if the entire page is one table.
Each page structured as one table and contains rows, and each row contains cells with recognized text and optional position information.
Returns: java.util.ArrayList<com.aspose.ocr.models.OCRTablePage> - an OCRTablePage structure representing all tables in the document (one page contains one table).
save(OutputStream stream)
public void save(OutputStream stream)
Save all recognition results to a memory stream in the specified format.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| stream | java.io.OutputStream | OutputStream for saving recognition result in the selected format. |
save(OutputStream stream, Format saveFormat)
public void save(OutputStream stream, Format saveFormat)
Save all recognition results to a memory stream in the specified format.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| stream | java.io.OutputStream | OutputStream for saving recognition result in the selected format. |
| saveFormat | Format | Document format (Docx, Txt, Pdf, Xlsx, Rtf, Json, Xml, Epub). |
save(OutputStream stream, Format saveFormat, String embeddedFontPath, PdfOptimizationMode optimizePdf)
public void save(OutputStream stream, Format saveFormat, String embeddedFontPath, PdfOptimizationMode optimizePdf)
Save all recognition results to a memory stream in the specified format.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| stream | java.io.OutputStream | OutputStream for saving recognition result in the selected format. |
| saveFormat | Format | Document format (Docx, Txt, Pdf, Xlsx, Rtf, Json, Xml, Epub). |
| embeddedFontPath | java.lang.String | Optional. Full path to the user font. |
| optimizePdf | PdfOptimizationMode | Reduce the PDF file size by lowering the quality of background images. By default, the original image quality is preserved. |
save(String fullFileName)
public void save(String fullFileName)
Save all recognition result to a file.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| fullFileName | java.lang.String | Filename with a path for saving recognition result in the selected format. |
save(String fullFileName, Format saveFormat)
public void save(String fullFileName, Format saveFormat)
Save all recognition result to a file.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| fullFileName | java.lang.String | Filename with a path for saving recognition result in the selected format. |
| saveFormat | Format | Document format (Docx, Txt, Pdf, Xlsx, Rtf, Json, Xml, Epub). |
save(String fullFileName, Format saveFormat, String embeddedFontPath, PdfOptimizationMode optimizePdf)
public void save(String fullFileName, Format saveFormat, String embeddedFontPath, PdfOptimizationMode optimizePdf)
Save all recognition result to a file.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| fullFileName | java.lang.String | Filename with a path for saving recognition result in the selected format. |
| saveFormat | Format | Document format (Docx, Txt, Pdf, Xlsx, Rtf, Json, Xml, Epub). |
| embeddedFontPath | java.lang.String | Optional. Full path to the user font. |
| optimizePdf | PdfOptimizationMode | Reduce the PDF file size by lowering the quality of background images. By default, the original image quality is preserved. |
savePdf(OutputStream stream)
public void savePdf(OutputStream stream)
Save all recognition results into an in-memory searchable PDF document, embedding the original images as the background.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| stream | java.io.OutputStream | OutputStream for saving recognition result in the selected format. |
savePdf(OutputStream stream, String embeddedFontPath, PdfOptimizationMode optimizePdf)
public void savePdf(OutputStream stream, String embeddedFontPath, PdfOptimizationMode optimizePdf)
Save all recognition results into an in-memory searchable PDF document, embedding the original images as the background.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| stream | java.io.OutputStream | OutputStream for saving recognition result in the selected format. |
| embeddedFontPath | java.lang.String | Optional. Full path to the user font. |
| optimizePdf | PdfOptimizationMode | Reduce the PDF file size by lowering the quality of background images. By default, the original image quality is preserved. |
savePdf(String fullFileName)
public void savePdf(String fullFileName)
Save all recognition results into a searchable PDF file, with the original images set as the background.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| fullFileName | java.lang.String | Filename with a path for saving recognition result in the selected format. |
savePdf(String fullFileName, String embeddedFontPath, PdfOptimizationMode optimizePdf)
public void savePdf(String fullFileName, String embeddedFontPath, PdfOptimizationMode optimizePdf)
Save all recognition results into a searchable PDF file, with the original images set as the background.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| fullFileName | java.lang.String | Filename with a path for saving recognition result in the selected format. |
| embeddedFontPath | java.lang.String | Optional. Full path to the user font. |
| optimizePdf | PdfOptimizationMode | Reduce the PDF file size by lowering the quality of background images. By default, the original image quality is preserved. |
size()
public int size()
Returns: int