You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Happy Human <ha...@gmail.com> on 2015/04/29 02:21:09 UTC

form field values not displaying

Hello,

Wondering if anyone can give some insight into the following issue. When
setting field values either with ImportXFDF, ImportFDF or a simple
field.setValue("foo") some fields do not display when the PDF is opened.

This seems to only happen when the fields font is set to "auto." The issue
apparently being there is no appearance for the form field yet. However,
some fields do render properly and I'm not sure why that is.

Also, setting the NeedsAppearances flag to true on the AcroForm dictionary
does force the viewer to render the fields properly. However, I'm also
attempting to "flatten" the PDF by removing the fields and appending the
normal appearance stream for the removed field to the document.

I'm using PDFBox 1.8.9.

Is it possible to create appearance streams for these fields or is there an
alternative approach?

Thank you,
-Dan

Re: form field values not displaying

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
Hi,
> Am 29.04.2015 um 02:21 schrieb Happy Human <ha...@gmail.com>:
> 
> Hello,
> 
> Wondering if anyone can give some insight into the following issue. When
> setting field values either with ImportXFDF, ImportFDF or a simple
> field.setValue("foo") some fields do not display when the PDF is opened.
> 
> This seems to only happen when the fields font is set to "auto." The issue
> apparently being there is no appearance for the form field yet. However,
> some fields do render properly and I'm not sure why that is.

there were some changes in 1.8 to handle the creation of appearance streams so there might be a specific issue with your form which is currently not being handled correctly.

Could you upload a sample form to a public location to take a look?

> 
> Also, setting the NeedsAppearances flag to true on the AcroForm dictionary
> does force the viewer to render the fields properly. However, I'm also
> attempting to "flatten" the PDF by removing the fields and appending the
> normal appearance stream for the removed field to the document.
> 
> I'm using PDFBox 1.8.9.
> 
> Is it possible to create appearance streams for these fields or is there an
> alternative approach?

You can of course generate the appearance stream yourself but as written above that should already be handled by PDFBox.

BR
Maruan

> 
> Thank you,
> -Dan


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