/** * Constructor with a given page size to initialize the clipping path. * @param page the size of the page */ public PDGraphicsState(PDRectangle page) { clippingPath = new Area(page.toGeneralPath()); }
Shape s = r.toGeneralPath().createTransformedShape(transAT); s = flipAT.createTransformedShape(s); s = rotateAT.createTransformedShape(s);
glyphBBox.setUpperRightX(Math.min(fontBBox.getUpperRightX(), glyphBBox.getUpperRightX())); glyphBBox.setUpperRightY(Math.min(fontBBox.getUpperRightY(), glyphBBox.getUpperRightY())); path = glyphBBox.toGeneralPath();
private Object[][] getGlyphs(PDType3Font font) throws IOException { Object[][] glyphs = new Object[256][4]; for (int index = 0; index <= 255; index++) { glyphs[index][0] = index; if (font.getEncoding().contains(index)) { glyphs[index][1] = font.getEncoding().getName(index); glyphs[index][2] = font.toUnicode(index); if (fontBBox.toGeneralPath().getBounds2D().isEmpty()) { glyphs[index][3] = NO_GLYPH; } else { glyphs[index][3] = renderType3Glyph(font, index); } totalAvailableGlyph++; } else { glyphs[index][1] = NO_GLYPH; glyphs[index][2] = NO_GLYPH; glyphs[index][3] = NO_GLYPH; } } return glyphs; }
/** * Constructor with a given page size to initialize the clipping path. * @param page the size of the page */ public PDGraphicsState(PDRectangle page) { clippingPath = new Area(page.toGeneralPath()); }
/** * Constructor with a given page size to initialize the clipping path. * @param page the size of the page */ public PDGraphicsState(PDRectangle page) { clippingPath = new Area(page.toGeneralPath()); }
/** * Given a PDF document and a 0-indexed page number, return the content of the page. * * <p> * This is the intended main entry point to this class. * </p> * * @param doc the document to process. * @param page the 0-indexed page number * @return the {@link PageContent} * @throws IOException if an error occurs during parsing (which could be due to badly encoded * {@link PDFont} data). */ public PageContent processPage(PDDocument doc, int page) throws IOException { textPositions = new ArrayList<>(); imagePositions = new ArrayList<>(); rectangles = new ArrayList<>(); lines = new ArrayList<>(); PDPage pdPage = doc.getPages().get(page); processPage(pdPage); Rectangle2D pageBounds = pdPage.getCropBox().toGeneralPath().getBounds2D(); return new PageContent(textPositions, imagePositions, lines, rectangles, pageBounds); }
Shape s = r.toGeneralPath().createTransformedShape(transAT); s = flipAT.createTransformedShape(s); s = rotateAT.createTransformedShape(s);
glyphBBox.setUpperRightX(Math.min(fontBBox.getUpperRightX(), glyphBBox.getUpperRightX())); glyphBBox.setUpperRightY(Math.min(fontBBox.getUpperRightY(), glyphBBox.getUpperRightY())); path = glyphBBox.toGeneralPath();
glyphBBox.setUpperRightX(Math.min(fontBBox.getUpperRightX(), glyphBBox.getUpperRightX())); glyphBBox.setUpperRightY(Math.min(fontBBox.getUpperRightY(), glyphBBox.getUpperRightY())); path = glyphBBox.toGeneralPath();