pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Mulder <ammul...@gmail.com>
Subject Text Field Appearance Streams
Date Sun, 24 Jul 2016 12:35:33 GMT
I am filling out a form on an existing PDF document.  The base
document has /NeedAppearances true and the result is that the text
looks different on every viewer.  For instance, on some the text is
offset vertically or the text is cut off when using a font that works
fine on a different viewer.

I gather the solution to this is to set /NeedAppearances to false and
provide an appearance stream for every field.  I don't know much about
appearance streams.

In looking at the output of the PDFBox examples, it seems that the
appearance stream actually writes the field's value as text, e.g. for
the form containing the text "Sample field" the appearance stream is:

1 1 198 48 re
/Helv 12 Tf
2 20.692 Td
(Sample field) Tj

Is there a way to not include the specific text in the appearance
stream such that if the user changes the value in the field then the
appearance stream will still work?

Really all I want from the appearance stream is to specify the font
and bounds and offset such that the text is in exactly the same place
on every viewer and the same font size fits into the available space
on every viewer.

And one more question -- the document has let's say 200 fields, and I
only populate maybe 50 of them.  If I specify appearance streams for
*only* the ones I populate, will that work?  If that's the case,
should /NeedAppearances be set to true or false?


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

View raw message