Hi,

As of now I'm trying to indicate to a user which fields they are required to fill out in an interactive pdf form. Initially I was simply adding a PDAnnotationHighlight element with the same coordinates as each widget belonging to the field object. However, I find the reverse process cumbersome; trying to find and remove all the PDHighlightAnnotations associated with a given PDField object (added previously) once the PDFields have been filled. And for this reason I was trying to use the setAppearanceCharacteristics function associated with each PDAnnotationWidget to just add a border around the field. So something like:

PDField field = pdf.getField("field");
List<PDAnnotationWidget> widgets = field.getWidgets();
for (PDAnnotationWidget widget : widgets) {
  PDAppearanceCharacteristicsDictionary acd = new PDAppearanceCharacteristicsDictionary(new COSDictionary());   acd.setBorderColour(new PDColor(new float[] { 0, 0, 1 }, PDDeviceRGB.INSTANCE));
  widget.setAppearanceCharacteristics(acd);
}

But after saving to disk it seems that the document is unchanged. Am I missing something here?

Thanks,

Jacob MacWilliams


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org

Reply via email to