if (annotation.getRectangle() == null) PDRectangle rect = annotation.getRectangle(); for (int i = 0; i < pathsArray.length / 2; ++i)
private void drawAnnotationLinkBorder(PDAnnotationLink link) throws IOException { AnnotationBorder ab = getAnnotationBorder(link, link.getBorderStyle()); if (ab.width == 0 || ab.color.getComponents().length == 0) { return; } PDRectangle rectangle = link.getRectangle(); Stroke oldStroke = graphics.getStroke(); graphics.setPaint(getPaint(ab.color)); BasicStroke stroke = new BasicStroke(ab.width, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10, ab.dashArray, 0); graphics.setStroke(stroke); graphics.setClip(null); if (ab.underline) { graphics.drawLine((int) rectangle.getLowerLeftX(), (int) rectangle.getLowerLeftY(), (int) (rectangle.getLowerLeftX() + rectangle.getWidth()), (int) rectangle.getLowerLeftY()); } else { graphics.drawRect((int) rectangle.getLowerLeftX(), (int) rectangle.getLowerLeftY(), (int) rectangle.getWidth(), (int) rectangle.getHeight()); } graphics.setStroke(oldStroke); }
private void drawAnnotationLinkBorder(PDAnnotationLink link) throws IOException { AnnotationBorder ab = getAnnotationBorder(link, link.getBorderStyle()); if (ab.width == 0 || ab.color.getComponents().length == 0) { return; } PDRectangle rectangle = link.getRectangle(); Stroke oldStroke = graphics.getStroke(); graphics.setPaint(getPaint(ab.color)); BasicStroke stroke = new BasicStroke(ab.width, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10, ab.dashArray, 0); graphics.setStroke(stroke); graphics.setClip(null); if (ab.underline) { graphics.drawLine((int) rectangle.getLowerLeftX(), (int) rectangle.getLowerLeftY(), (int) (rectangle.getLowerLeftX() + rectangle.getWidth()), (int) rectangle.getLowerLeftY()); } else { graphics.drawRect((int) rectangle.getLowerLeftX(), (int) rectangle.getLowerLeftY(), (int) rectangle.getWidth(), (int) rectangle.getHeight()); } graphics.setStroke(oldStroke); }
PDRectangle rect = link.getRectangle();