-
-
Save GroupDocsGists/02ead0f09538ef40ea82af00dc096a29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/groupdocs-parser/GroupDocs.Parser-for-Java | |
// Create a text extractor for PDF documents | |
try (PdfTextExtractor extractor = new PdfTextExtractor(Common.mapSourceFilePath(FILE_PATH))) { | |
// Create table detector parameters | |
TableAreaDetectorParameters parameters = new TableAreaDetectorParameters(); | |
// Set vertical separators | |
parameters.setVerticalSeparators(new ArrayList()); | |
parameters.getVerticalSeparators().add(185.0); | |
parameters.getVerticalSeparators().add(370.0); | |
parameters.getVerticalSeparators().add(425.0); | |
parameters.getVerticalSeparators().add(485.0); | |
parameters.getVerticalSeparators().add(545.0); | |
// Set a rectangular area that bounds a table | |
parameters.setRectangle(new Rectangle(175, 350, 400, 200)); | |
// Create a table detector | |
TableAreaDetector detector = new TableAreaDetector(extractor.getDocumentContent()); | |
// Detect a table on the first page with detector parameters | |
List<TableAreaLayout> layout = detector.detectLayouts(0, parameters); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment