Details
Description
I have 5 fields with same name(lets say 'wcode') in different places on a one page pdf form. This fields have different fonts. Normally when you fill out one field manually the other fields automatically pick the sames value, the same this happens when I fill it using PDFbox except that PDFBox changes all my 5 fields to have same font as the first field to appear in the pdf form.
Here is the code used to fill the field.
PDDocument _pdfDocument = PDDocument.load(new File(originalPdf)) PDAcroForm acroForm = _pdfDocument.getDocumentCatalog().getAcroForm(); PDTextField myCodeField = (PDTextField) acroForm.getField("wcode"); if (myCodeField != null) { myCodeField .setValue(my.getCode()); } //Refresh layout && Flatten the document acroForm.refreshAppearances(); acroForm.flatten(); _pdfDocument.save(outputFile);
I added
acroForm.refreshAppearances();
after some research but that did not change anything.
So if the first 'wcode' field to appear on the pdf form is 6pt all the other 'wcode' fields in the rest the pdf will be 6pt even if I had set them in appearance properties to 12pt.
On the attached pdf the affected field is called CountyCode
Attachments
Attachments
Issue Links
- is a clone of
-
PDFBOX-3687 PDFBox doesn't respect different setting of /DA at PDAnnotationWidget level to /DA at PDField level
- Closed