pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Lehmkühler (JIRA) <j...@apache.org>
Subject [jira] [Comment Edited] (PDFBOX-1036) FDFExport/Import gives strange results
Date Mon, 03 Nov 2014 07:33:33 GMT

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

Andreas Lehmkühler edited comment on PDFBOX-1036 at 11/3/14 7:32 AM:
---------------------------------------------------------------------

Maybe it's a question of the expected result. We are reusing most of an existing appearance
stream, only the text and the font size will be replaced. So, do we expect that the resulting
text will have the same size than the former text? If so, we need to reuse it. Only if the
new text is far more longer than the old one, we might wanna scale the font size down, so
that the new text will fit into the textfield. If we reuse the font size, we have to calculate
the theorectical font size too and use the smaller one of both. The latter is only true if
the textfield isn't scrollable.

Acrobat reader reuses the font size if one replaces the text manually.


was (Author: lehmi):
Maybe it's a question of the expected result. We are reusing most of an existing appearance
stream, only the text and the font size will be replaced. So, do we expect that the resulting
text will have the same size than the former text? If so, we need to reuse it. Only if the
new text is far more longer than the old one, we might wanna scale the font size down, so
that the new text will fit into the textfield. If we reuse the font size, we have to calculate
the theorectical font size too and use the smaller one of both.

> FDFExport/Import gives strange results
> --------------------------------------
>
>                 Key: PDFBOX-1036
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1036
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.8.7, 2.0.0
>         Environment: Windows 7, Acrobat Pro 9.4.4, Eclipse Helios SR2
>            Reporter: Gilad Denneboom
>            Assignee: Andreas Lehmkühler
>              Labels: AcroForm, FDF
>             Fix For: 1.8.8, 2.0.0
>
>         Attachments: result.pdf, test.fdf, test.pdf
>
>
> 1. Create a new, blank PDF in Acrobat.
> 2. Add a text form field and set the contents to "some text".
> 3. Run ExportFDF and then ImportFDF on this file.
> The result is a messed-up text box. See the attached files.
> Also I've noticed that the FDF created by PDFBox is very different to the one created
by Acrobat.
> Here's my code:
>         ExportFDF.main(new String[]{"c:/gilad/input/test.pdf", "c:/gilad/input/test.fdf"});
> 	ImportFDF.main(new String[]{"c:/gilad/input/test.pdf", "c:/gilad/input/test.fdf", "c:/gilad/input/result.pdf"});



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

Mime
View raw message