0

I am using PDFbox java api to fill out the values in PDF.

I can fill the textbox values. When I use check() method for checkboxes as shown How to check a check box in PDF-form using Java PDFBOX api it set value to true in background but that does not reflect when I open the pdf.

checkbox is still blank without any value.

does anyone know how to fix this issue ?

Community
  • 1
  • 1
user583726
  • 647
  • 2
  • 9
  • 20
  • I just tested the solution in the answer of the question you referred to and it works all right with my test document. Thus, either your code does something differently or your PDF is special. Could you, therefore, supply code and sample PDF? Which program do you open the PDF with? – mkl Jul 16 '13 at 14:55
  • I tried to use this PDF and it also has the same problem : http://www.irs.gov/pub/irs-pdf/fw4.pdf. I tried to check Married , Single lower section of w4 on first page. – user583726 Jul 18 '13 at 14:29
  • That form is not a pure AcroForm form. It looks like a hybrid of AcroForm and XFA form. As far as I know PDFBox only sees and manipulates the AcroForm part. Thus, PDF viewers prefering the XFA form will not see the changes. – mkl Jul 18 '13 at 19:04
  • thanks for the answer. Do you know if I can use other tool to achieve the same thing ? – user583726 Jul 18 '13 at 20:24
  • You might try itext. But hybrid forms can mean quite a hassle. – mkl Jul 20 '13 at 12:19

0 Answers0