pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Duane Nickull <du...@technoracle-systems.com>
Subject Re: PDF form fill doesn't work
Date Mon, 19 Nov 2012 16:42:27 GMT
Can you send me the form? There are many types of PDF forms.  Acroforms
are easiest but there are FDF, XFDF and XFA as well.

Duane Nickull
Technoracle Advanced Systems Inc.
Consulting and Contracting; Proven Results!
i.  Neo4J, PDF, Java, LiveCycle ES, Flex, AIR, CQ5 & Mobile
b. http://technoracle.blogspot.com
t.  @duanechaos
"Don't fear the Graph!  Embrace Neo4J"

On 2012-11-19 4:19 AM, "Milan Stojanovic" <stojanovic.milan@gmail.com>

>I have a PDF file with some form fields that I need to fill in from Java
>code. I use PDFBox library for this, and this code:
>PDDocument pdfDoc =
>docCatalog = pdfDoc.getDocumentCatalog();PDAcroForm acroForm =
>docCatalog.getAcroForm();PDField field =
>(field != null) {
>    field.setValue("Milan");} else {
>    System.err.println("No field found with name:" +
>The PDF is not created by me, so I don't know what type of form the file
>uses (if I understand correctly, there are FDF and XFA forms). Since the
>PDF is not created by me, I used this tool
>http://support.persits.com/pdf/demo_formfields.asp to find out the names
>the form fields, and it gave me this:
>When I use this long field name, I don't get any errors, but the resulting
>PDF does not contain the value I put in the field. I thought that maybe
>there was something wrong with the field name, so I used Pdftk
>gave me just txtFirstName for the field name. But when I use just that, I
>get the No field found with name: txtFirstName error. Help?

View raw message