PDFTextStripperByArea.java (pdfbox-2.0.23-src) | : | PDFTextStripperByArea.java (pdfbox-2.0.24-src) | ||
---|---|---|---|---|
skipping to change at line 115 | skipping to change at line 115 | |||
} | } | |||
/** | /** | |||
* Process the page to extract the region text. | * Process the page to extract the region text. | |||
* | * | |||
* @param page The page to extract the regions from. | * @param page The page to extract the regions from. | |||
* @throws IOException If there is an error while extracting text. | * @throws IOException If there is an error while extracting text. | |||
*/ | */ | |||
public void extractRegions( PDPage page ) throws IOException | public void extractRegions( PDPage page ) throws IOException | |||
{ | { | |||
for (String region : regions) | for (String regionName : regions) | |||
{ | { | |||
setStartPage(getCurrentPageNo()); | setStartPage(getCurrentPageNo()); | |||
setEndPage(getCurrentPageNo()); | setEndPage(getCurrentPageNo()); | |||
//reset the stored text for the region so this class | // reset the stored text for the region so this class can be reused. | |||
//can be reused. | ||||
String regionName = region; | ||||
ArrayList<List<TextPosition>> regionCharactersByArticle = new ArrayL ist<List<TextPosition>>(); | ArrayList<List<TextPosition>> regionCharactersByArticle = new ArrayL ist<List<TextPosition>>(); | |||
regionCharactersByArticle.add( new ArrayList<TextPosition>() ); | regionCharactersByArticle.add( new ArrayList<TextPosition>() ); | |||
regionCharacterList.put( regionName, regionCharactersByArticle ); | regionCharacterList.put( regionName, regionCharactersByArticle ); | |||
regionText.put( regionName, new StringWriter() ); | regionText.put( regionName, new StringWriter() ); | |||
} | } | |||
if( page.hasContents() ) | if( page.hasContents() ) | |||
{ | { | |||
processPage( page ); | processPage( page ); | |||
} | } | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 2 lines changed or added |