List of usage examples for org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination PDPageXYZDestination getPage
public PDPage getPage()
From source file:org.xwiki.test.misc.PDFTest.java
License:Open Source License
private String getDestinationText(PDPageXYZDestination destination) throws Exception { PDFTextStripperByArea stripper = new PDFTextStripperByArea(); stripper.addRegion("destination", getRectangleBelowDestination(destination)); stripper.extractRegions(destination.getPage()); return stripper.getTextForRegion("destination").trim(); }
From source file:org.xwiki.test.misc.PDFTest.java
License:Open Source License
private Rectangle2D getRectangleBelowDestination(PDPageXYZDestination destination) { PDPage page = destination.getPage(); PDRectangle pageSize = page.getMediaBox(); float x = destination.getLeft(); float y = pageSize.getHeight() - destination.getTop(); float width = pageSize.getWidth(); float height = destination.getTop(); return new Rectangle2D.Float(x, y, width, height); }