public class PdfTextExtractionUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
PdfTextExtractionUtils.ResultsComparator |
protected static class |
PdfTextExtractionUtils.ResultsComparatorRectangle |
| Modifier | Constructor and Description |
|---|---|
protected |
PdfTextExtractionUtils(PdfData pdf_data,
boolean isXMLExtraction)
Create a new instance, passing in raw data
|
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,String> |
extractTextAsTable(int x1,
int y1,
int x2,
int y2,
int pageNumber,
boolean isCSV,
boolean keepFontInfo,
boolean keepWidthInfo,
boolean keepAlignmentInfo,
int borderWidth)
Calls various low level merging routines on merge -
|
protected List<String> |
extractTextAsWordlist(int x1,
int y1,
int x2,
int y2,
int page_number,
boolean breakFragments,
String punctuation)
Algorithm to place data from within coordinates to a vector of word, word coords (x1,y1,x2,y2)
|
protected String |
extractTextInRectangle(int x1,
int y1,
int x2,
int y2,
int page_number,
boolean estimateParagraphs,
boolean breakFragments)
Algorithm to place data from specified coordinates on a page into a String.
|
protected PdfTextExtractionUtils(PdfData pdf_data, boolean isXMLExtraction)
pdf_data - PdfData from the pdf to searchisXMLExtraction - Boolean flag to specify if output should be xmlprotected final Map<String,String> extractTextAsTable(int x1, int y1, int x2, int y2, int pageNumber, boolean isCSV, boolean keepFontInfo, boolean keepWidthInfo, boolean keepAlignmentInfo, int borderWidth) throws PdfException
isCSV sets if output is XHTML or CSV format -
XHTML also has options to include font tags (keepFontInfo), preserve widths (keepWidthInfo), try to preserve alignment (keepAlignmentInfo), and set a table border width (borderWidth) - AddCustomTags should always be set to false
x1 - is the x coord of the top left cornery1 - is the y coord of the top left cornerx2 - is the x coord of the bottom right cornery2 - is the y coord of the bottom right cornerpageNumber - is the page you wish to extract fromisCSV - is a boolean. If false the output is xhtml if true the text is out as CSVkeepFontInfo - if true and isCSV is false keeps font information in extrated text.keepWidthInfo - if true and isCSV is false keeps width information in extrated text.keepAlignmentInfo - if true and isCSV is false keeps alignment information in extrated text.borderWidth - is the width of the border for xhtmlPdfException - If the co-ordinates are not validprotected final List<String> extractTextAsWordlist(int x1, int y1, int x2, int y2, int page_number, boolean breakFragments, String punctuation) throws PdfException
x1 - is the x coord of the top left cornery1 - is the y coord of the top left cornerx2 - is the x coord of the bottom right cornery2 - is the y coord of the bottom right cornerpage_number - is the page you wish to extract frombreakFragments - will divide up text based on white space characterspunctuation - is a string containing all values that should be used to divide up wordsPdfException - If the co-ordinates are not validprotected final String extractTextInRectangle(int x1, int y1, int x2, int y2, int page_number, boolean estimateParagraphs, boolean breakFragments) throws PdfException
x1 - is the x coord of the top left cornery1 - is the y coord of the top left cornerx2 - is the x coord of the bottom right cornery2 - is the y coord of the bottom right cornerpage_number - is the page you wish to extract fromestimateParagraphs - will attempt to find paragraphs and add new lines in output if truebreakFragments - will divide up text based on white space characters if truePdfException - If the co-ordinates are not validCopyright © 2017. All rights reserved.