[ 
https://issues.apache.org/jira/browse/PDFBOX-3111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15121535#comment-15121535
 ] 

Rees Byars commented on PDFBOX-3111:
------------------------------------

As a partial work around for someone needing the fields to be treated as one, I 
believe using PDocument.importPage treats the fields as oner.

For instance: 

{code:java}
sourceDocument.getPages().forEach(new Consumer<PDPage>() {
           @Override 
            public void accept(PDPage pdPage) {
                try {
                    destinationDocument.importPage(pdPage);
                } catch (IOException e) {
                    throw new RuntimeException("Could not import page", e);
                }
            }
        });
{code}

The merge utility needs to continue supporting the current renaming field 
merge. There is a common business use case of appending the same form multiple 
times, but with different data in the fields. If the case of merging without 
renaming is needed in the merge utility in some instances, then it ought to be 
offered as a setting, such that renaming can be disabled if desired.

> Replicate Acrobat behavior when merging PDFs with interactive forms
> -------------------------------------------------------------------
>
>                 Key: PDFBOX-3111
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3111
>             Project: PDFBox
>          Issue Type: New Feature
>          Components: AcroForm
>    Affects Versions: 1.8.10, 2.0.0
>            Reporter: Maruan Sahyoun
>
> When PDFs containing interactive forms are merged using Acrobat, fields with 
> the same name are merged into one. That's different to the current behavior 
> of PDFBox which renames to be merged fields so they have a unique name (see 
> PDFBOX-3094)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to