pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilad Denneboom <gilad.denneb...@gmail.com>
Subject Re: Applying a Normal Icon appearance to a Push-button
Date Wed, 16 Dec 2015 13:04:10 GMT
So here's what I did... I created in Acrobat a new PDF file with a button
that has the icon I want to use.
I load that file in my app and copy the AppearanceCharacteristics and
NormalAppearance map from that button into variables.
Then I create the button in my main file and apply these two objects to its
widget. So far as good... I then save the mail file and close both of them.
When I open the main file in Acrobat I can see the icon I've copied under
the Properties of the button field, but it's not visible on the page itself.
I also set "NeedAppearances" to TRUE, just for good measure, but it didn't
help.

Any ideas?

On Sun, Dec 13, 2015 at 8:10 PM, Maruan Sahyoun <sahyoun@fileaffairs.de>
wrote:

> If you need additional information please let me know
>
>
> > Am 13.12.2015 um 19:52 schrieb Gilad Denneboom <
> gilad.denneboom@gmail.com>:
> >
> > Thanks for the info, Maruan. I'll play around with it and see what I can
> > come up with...
> >
> > On Sun, Dec 13, 2015 at 6:26 PM, Maruan Sahyoun <sahyoun@fileaffairs.de>
> > wrote:
> >
> >> Hi,
> >>
> >> you can do
> >>
> >> PDAnnotationWidget widget = field.getWidgets().get(0);
> >> PDAppearanceDictionary apDictionary = widget.getAppearance();
> >> apDictionary.setNormalAppearance(PDAppearanceStream stream);
> >>
> >> Unfortunately for the appearance stream you are on you own as for the
> >> exact look of a push button there are no details in the specification.
> What
> >> you could do is look at the appearance stream as Adobe generates is and
> >> replicate it.
> >>
> >> Now if you know how the content should look like you can use
> >>
> >> PDPageContentStream(PDDocument doc, PDAppearanceStream appearance)
> >>
> >> which gives you a higher level API to add content to your appearance
> >> stream.
> >>
> >> Hope that helps.
> >>
> >> BR
> >> Maruan
> >>
> >> PS: I'm planning to add the ability to add some default appearances for
> >> the different field types when adding new fields via PDFBox but will not
> >> start before 2.0 has been released.
> >>
> >>
> >>>> Am 12.12.2015 um 10:11 schrieb Gilad Denneboom <
> >>> gilad.denneboom@gmail.com>:
> >>>
> >>> Hi all,
> >>>
> >>> Using PDFBox 1.8.10 (or 2.0.0-RC2, whatever works), is there an option
> to
> >>> set the Normal Icon appearance stream of a push-button? I only see a
> >> getter
> >>> for this property, not a setter, and attempts to find information
> online
> >>> about how to achieve it have been unsuccessful.
> >>>
> >>> I would appreciate any tips or sample code that will help me solve this
> >>> problem...
> >>>
> >>> Thanks in advance, Gilad.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> >> For additional commands, e-mail: users-help@pdfbox.apache.org
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message