[
https://issues.apache.org/jira/browse/PDFBOX-3803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16024447#comment-16024447
]
Maruan Sahyoun commented on PDFBOX-3803:
----------------------------------------
The current implementation of the appearance generation is correct to some
extend as only one of the fields has a non empty field value and the fields are
treated separately. There is however an issue with the field definition itself.
{quote}
In particular, field dictionaries with the same fully qualified field name must
have the same field type (FT), value (V), and default value (DV).
{quote}
which is not the case here. So strictly speaking the field value hasn't been
set correctly. There are two ways to deal with it. We could either a) modify
{{PDAcroForm.getField(String fullyQualifiedName)}} to return a {{List}} of
fields or b) combine the fields behind the scene the same way Adobe does. One
could deal with it when generating the PDF form though.
I'd go for b) but this is introducing yet another unspecified mechanism. Maybe
it's even better to introduce a) on the PDModel level and b) in a yet to be
developed form filling service/app/util which will sit on top of PD and be more
application oriented. WDYT?
> Fields missing after refreshAppearances
> ---------------------------------------
>
> Key: PDFBOX-3803
> URL: https://issues.apache.org/jira/browse/PDFBOX-3803
> Project: PDFBox
> Issue Type: Bug
> Components: AcroForm
> Affects Versions: 3.0.0
> Reporter: simon steiner
> Attachments: input.pdf
>
>
> Fields missing after viewing in Adobe Reader after running:
> PDDocument doc = PDDocument.load(new File(input));
> PDAcroForm acroform = doc.getDocumentCatalog().getAcroForm();
> if (acroform != null) {
> acroform.setNeedAppearances(false);
> acroform.refreshAppearances();
> }
> doc.save(output);
> doc.close();
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]