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

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=15430967#comment-15430967 ] 

ASF subversion and git services commented on PDFBOX-3470:
---------------------------------------------------------

Commit 1757199 from [~tilman] in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1757199 ]

PDFBOX-3470: improve example with non standard text, border and background color

> 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