static float getLineWidth(PDAnnotationWidget widget) { PDBorderStyleDictionary bs = widget.getBorderStyle(); if (bs != null) { return bs.getWidth(); } return 1; } }
static float getLineWidth(PDAnnotationWidget widget) { PDBorderStyleDictionary bs = widget.getBorderStyle(); if (bs != null) { return bs.getWidth(); } return 1; }
lineWidth = 1f; PDBorderStyleDictionary borderStyle = widget.getBorderStyle(); if (borderStyle != null && borderStyle.getWidth() > 0)
PDColor borderColor = appearanceCharacteristics.getBorderColour(); float lineWidth = getLineWidth(widget); yesAPCS.setBorderLine(lineWidth, widget.getBorderStyle(), widget.getBorder()); yesAPCS.setNonStrokingColor(backgroundColor); yesAPCS.addRect(0, 0, rect.getWidth(), rect.getHeight());
if (widget.getBorderStyle() != null) borderWidth = widget.getBorderStyle().getWidth();
private static PDAppearanceStream createCheckBoxAppearanceStream( final PDDocument document, PDAnnotationWidget widget, boolean on) throws IOException { PDRectangle rect = widget.getRectangle(); PDAppearanceStream onAP = new PDAppearanceStream(document); onAP.setBBox(new PDRectangle(rect.getWidth(), rect.getHeight())); try (PDAppearanceContentStream onAPCS = new PDAppearanceContentStream(onAP)) { PDAppearanceCharacteristicsDictionary appearanceCharacteristics = widget.getAppearanceCharacteristics(); PDColor backgroundColor = appearanceCharacteristics.getBackground(); PDColor borderColor = appearanceCharacteristics.getBorderColour(); float lineWidth = getLineWidth(widget); onAPCS.setBorderLine(lineWidth, widget.getBorderStyle(), widget.getBorder()); onAPCS.setNonStrokingColor(backgroundColor); float radius = Math.min(rect.getWidth() / 2, rect.getHeight() / 2); drawCircle(onAPCS, rect.getWidth() / 2, rect.getHeight() / 2, radius); onAPCS.fill(); onAPCS.setStrokingColor(borderColor); drawCircle(onAPCS, rect.getWidth() / 2, rect.getHeight() / 2, radius - lineWidth / 2); onAPCS.stroke(); if (on) { onAPCS.setNonStrokingColor(0f); drawCircle(onAPCS, rect.getWidth() / 2, rect.getHeight() / 2, (radius - lineWidth) / 2); onAPCS.fill(); } } return onAP; }
lineWidth = 1f; PDBorderStyleDictionary borderStyle = widget.getBorderStyle(); if (borderStyle != null && borderStyle.getWidth() > 0)
lineWidth = 1f; PDBorderStyleDictionary borderStyle = widget.getBorderStyle(); if (borderStyle != null && borderStyle.getWidth() > 0)
if (widget.getBorderStyle() != null) borderWidth = widget.getBorderStyle().getWidth();
if (widget.getBorderStyle() != null) borderWidth = widget.getBorderStyle().getWidth();