-
Notifications
You must be signed in to change notification settings - Fork 15
Examples
Christian Clausner edited this page Jan 2, 2018
·
9 revisions
try {
`//Load page`
`Page page = PageXmlInputOutput.readPage("c:\\temp\\text.xml");`
`//Iterate over regions`
`for (int i=0; i<page.getLayout().getRegionCount(); i++) {`
`Region region = page.getLayout().getRegion(i);`
`}`
`//Iterate over regions using iterator`
`for (RegionIterator it = new RegionIterator(page.getLayout(), RegionType.TextRegion, null); it.hasNext(); ) {`
`Region region = (Region)it.next();`
`}`
`//Iterate over text lines`
`for (LowLevelTextObjectIterator it = new LowLevelTextObjectIterator(page.getLayout(), LowLevelTextType.TextLine, null); it.hasNext(); ) {`
`TextLine textLine = (TextLine)it.next();`
`} `
} catch (Exception e) {
e.printStackTrace();
}