private int resolveRotation(PDAnnotationWidget widget) { PDAppearanceCharacteristicsDictionary characteristicsDictionary = widget.getAppearanceCharacteristics(); if (characteristicsDictionary != null) { // 0 is the default value if the R key doesn't exist return characteristicsDictionary.getRotation(); } return 0; }
PDAppearanceCharacteristicsDictionary appearanceCharacteristics = widget.getAppearanceCharacteristics();
private int resolveRotation(PDAnnotationWidget widget) { PDAppearanceCharacteristicsDictionary characteristicsDictionary = widget.getAppearanceCharacteristics(); if (characteristicsDictionary != null) { // 0 is the default value if the R key doesn't exist return characteristicsDictionary.getRotation(); } return 0; }
try (PDAppearanceContentStream yesAPCS = new PDAppearanceContentStream(yesAP)) appearanceCharacteristics = widget.getAppearanceCharacteristics(); PDColor backgroundColor = appearanceCharacteristics.getBackground(); PDColor borderColor = appearanceCharacteristics.getBorderColour();
private int resolveRotation(PDAnnotationWidget widget) { PDAppearanceCharacteristicsDictionary characteristicsDictionary = widget.getAppearanceCharacteristics(); if (characteristicsDictionary != null) { // 0 is the default value if the R key doesn't exist return characteristicsDictionary.getRotation(); } return 0; }
if (widget.getAppearanceCharacteristics() != null || appearanceStream.getContentStream().getLength() == 0)
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; }
PDAppearanceCharacteristicsDictionary appearanceCharacteristics = widget.getAppearanceCharacteristics();
PDPageContentStream contents = new PDPageContentStream(field.getAcroForm().getDocument(), appearanceStream, output); PDAppearanceCharacteristicsDictionary appearanceCharacteristics = widget.getAppearanceCharacteristics();
if (widget.getAppearanceCharacteristics() != null || appearanceStream.getContentStream().getLength() == 0)
if (widget.getAppearanceCharacteristics() != null || appearanceStream.getContentStream().getLength() == 0)