views:

33

answers:

0

I have a document template in Word .doc format. The Word document contains Merge fields that needs to be populated dynamically.

I need to convert the Word document to a PDF with form fields. This PDF can then be populated from our Java application quite easily with iText.

The problem I am experiencing is when I try to convert the Word document to PDF. I want the mail merge fields converted to to form fields but none of the tools I have tried seem to do that.

I have tried:

  • Microsoft Office 2007 save as PDF (Only creates a PDF as text, no form fields)
  • PDFCreator (Also just text)
  • Docx4j (I saved the doc as docx and then converted to xml) which uses Apache FOP AFAIK (Also just text, it displays the Merge fields as MERGEFIELD "Surname" while the others display <<Surname>> as it appears in the Doc)
  • I tried opening the PDFs generated in Scribus but each I just get an error that it is not in an acceptable format

Does anyone know of a tool or a Java library available that can do what I need (preferably free)?