Tilman Hausherr created PDFBOX-3470:
---------------------------------------

             Summary: Set border and background color in AcroForm field 
appearance
                 Key: PDFBOX-3470
                 URL: https://issues.apache.org/jira/browse/PDFBOX-3470
             Project: PDFBox
          Issue Type: Bug
    Affects Versions: 2.0.2, 2.0.1, 2.0.3
            Reporter: Tilman Hausherr
             Fix For: 2.0.3, 2.1.0


Follow-up on PDFBOX-2918 - set border and background color so that the 
CreateSimpleForm.java example can be improved with this code, which I've had 
for some time and forgot to commit:
{code}
        // set green border and yellow background
        // if you prefer defaults, just delete this code block
        PDAppearanceCharacteristicsDictionary fieldAppearance
                = new PDAppearanceCharacteristicsDictionary(new 
COSDictionary());
        fieldAppearance.setBorderColour(new PDColor(new float[]{0,1,0}, 
PDDeviceRGB.INSTANCE));
        fieldAppearance.setBackground(new PDColor(new float[]{1,1,0}, 
PDDeviceRGB.INSTANCE));
        widget.setAppearanceCharacteristics(fieldAppearance);
{code}
without needing to call {{acroForm.setNeedAppearances(true);}}. While looking 
at it, I also found a bug in the current code, the border color is set with the 
non stroking color.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to