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

Maruan Sahyoun commented on PDFBOX-3915:
----------------------------------------

The reason is that the PDF is an XFA based static PDF form. When filling out 
the form with Adobe Reader it looks at the definition in the XFA where PDFBox 
takes the definition from the PDF form fields.

If you remove the XFA from the PDF using

{code}
        PDDocument pdfDocument = PDDocument.load(new File("b232.pdf"));
        pdfDocument.setAllSecurityToBeRemoved(true);
        PDAcroForm acroForm = pdfDocument.getDocumentCatalog().getAcroForm();
        acroForm.getCOSObject().removeItem(COSName.XFA);
        pdfDocument.save("b232-noxfa.pdf");
        pdfDocument.close();
{code}

and then fill out the form using adobe reader you will get a similar result 
being filled using PDFBox.

> line height problem filling form pdtextbox
> ------------------------------------------
>
>                 Key: PDFBOX-3915
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3915
>             Project: PDFBox
>          Issue Type: Task
>          Components: AcroForm
>    Affects Versions: 2.0.4
>         Environment: Windows
>            Reporter: Ken F
>         Attachments: address_box.png, address.pdf, b232.pdf
>
>
> I use pdfbox to fill a form. One of fields is address (multiline). If I use 
> keyboard to enter, the field can accommodate 4 lines. However if I use pdfbox 
> such as
>     field.setValue("line 1 \n line2 \n line3 \n line4"), it only accommodates 
> 2 lines. I notice that the height of each line is much bigger than what is 
> entered using keyboard, and so the field only has space for 2 lines now.
> The font size looks the same in both cases. One just has more space between 
> lines than the other. Did anyone have this issue before? Appreciate any help.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to