| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final Map | |
| private final List | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addRegion(String
The name of the region. regionName, Rectangle2D The rectangle area to retrieve the text from. The y-coordinates are java
coordinates (y == 0 is top), not PDF coordinates (y == 0 is bottom). rect)Add a new region to group text by. |
| public void | extractRegions(PDPage
The page to extract the regions from. page)Process the page to extract the region text. |
| public List | Returns: A list of java.lang.String objects to identify the region names.Get the list of regions that have been setup. |
| public String | Returns: The text that was identified in that region.The name of the region to get the text from. regionName)Get the text for the region, this should be called after extractRegions(). |
| protected void | processTextPosition(TextPosition
The text to process. text)Overrides org. This will process a TextPosition object and add the text to the list of characters on a page. |
| public void | |
| public final void | setShouldSeparateByBeads(boolean
The new grouping of beads. aShouldSeparateByBeads)Overrides org. This method does nothing in this derived class, because beads and regions are incompatible. |
| protected void | writePage()
Overrides org. This will print the processed page text to the output stream. |
| regionArea | back to summary |
|---|---|
| private final Map<String, Rectangle2D> regionArea | |
| regionCharacterList | back to summary |
|---|---|
| private final Map<String, ArrayList<List<TextPosition>>> regionCharacterList | |
| regions | back to summary |
|---|---|
| private final List<String> regions | |
| regionText | back to summary |
|---|---|
| private final Map<String, StringWriter> regionText | |
| PDFTextStripperByArea | back to summary |
|---|---|
| public PDFTextStripperByArea() throws IOException Constructor.
| |
| addRegion | back to summary |
|---|---|
| public void addRegion(String regionName, Rectangle2D rect) Add a new region to group text by.
| |
| extractRegions | back to summary |
|---|---|
| public void extractRegions(PDPage page) throws IOException Process the page to extract the region text.
| |
| getRegions | back to summary |
|---|---|
| public List Get the list of regions that have been setup. | |
| getTextForRegion | back to summary |
|---|---|
| public String getTextForRegion(String regionName) Get the text for the region, this should be called after extractRegions(). | |
| processTextPosition | back to summary |
|---|---|
| protected void processTextPosition(TextPosition text) Overrides org. Doc from org. This will process a TextPosition object and add the text to the list of characters on a page. It takes care of overlapping text.
| |
| removeRegion | back to summary |
|---|---|
| public void removeRegion(String regionName) Delete a region to group text by. If the region does not exist, this method does nothing.
| |
| setShouldSeparateByBeads | back to summary |
|---|---|
| public final void setShouldSeparateByBeads(boolean aShouldSeparateByBeads) Overrides org. This method does nothing in this derived class, because beads and regions are incompatible. Beads are ignored when stripping by area.
| |
| writePage | back to summary |
|---|---|
| protected void writePage() throws IOException Overrides org. This will print the processed page text to the output stream.
| |