You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2016/08/22 15:17:20 UTC

[jira] [Updated] (PDFBOX-3470) Set border and background color in AcroForm field appearance

     [ https://issues.apache.org/jira/browse/PDFBOX-3470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tilman Hausherr updated PDFBOX-3470:
------------------------------------
    Component/s: AcroForm

> 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
>          Components: AcroForm
>    Affects Versions: 2.0.1, 2.0.2, 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: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org