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

ASF GitHub Bot commented on PDFBOX-4172:
----------------------------------------

GitHub user michael-dev opened a pull request:

    https://github.com/apache/pdfbox/pull/45

    PDFBOX-4172: do translation when no PDFormXObject is encountered

    I've created PDF forms using LibreOffice 5 and for one file, the first
    form element will not show up filled when flattening the PDF.
    
    It turns out that resolveNeedsTranslation does not hit a PDFormXObject
    and thus returns false, although translation is actually needed.
    
    This patch fixes this by tracking whether any PDFormXObject has been
    encountered and returning true when none is seen.
    
    https://issues.apache.org/jira/browse/PDFBOX-4172

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/michael-dev/pdfbox bugfix/flattenCorrectly

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/pdfbox/pull/45.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #45
    
----
commit fed3b1fc607d085f081a5a94bc2deb2dfd73acd4
Author: Michael Braun <michael-dev@...>
Date:   2018-03-29T06:32:14Z

    PDFBOX-4172: do translation when no PDFormXObject is encountered
    
    I've created PDF forms using LibreOffice 5 and for one file, the first
    form element will not show up filled when flattening the PDF.
    
    It turns out that resolveNeedsTranslation does not hit a PDFormXObject
    and thus returns false, although translation is actually needed.
    
    This patch fixes this by tracking whether any PDFormXObject has been
    encountered and returning true when none is seen.
    
    https://issues.apache.org/jira/browse/PDFBOX-4172

----


> Flatten fails on first form element only
> ----------------------------------------
>
>                 Key: PDFBOX-4172
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4172
>             Project: PDFBox
>          Issue Type: Bug
>          Components: AcroForm
>    Affects Versions: 2.0.9
>            Reporter: [email protected]
>            Priority: Major
>         Attachments: example-filled-2.0.9.pdf, example-filled-fixed.pdf, 
> example.java, example.pdf
>
>
> I've create an PDF form using LibreOffice 5. For this document, the first 
> form element refuses to turn up filled when filling + flattening using PDFBox 
> 2.0.9 als well as trunk (512d016ad08a70dfb512f99d54092f8b586e8345).
> It turns out that resolveNeedsTranslation does not encounter any 
> PDFormXObject for the first element of this pdf form element but still 
> returns false, although translation is still needed.
> I've created a patch in 
> [https://github.com/michael-dev/pdfbox/tree/bugfix/flattenCorrectly] .
> I used evince 3.18.2 as pdf viewer. Please see attached example pdf form and 
> the different results using pdfbox 2.0.9 and with the above patch applied. 
> The code used here is in example.java.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to