samedi 24 février 2018

itext - pdf checkbox filled differently

I have a pdf fillbale form with a checkbox in it. If i use the acrobat reader, the checkbox is filled like this checkbox filled by acrobat

but, if i use itext 5.5.13, the checkbox is filled like the the one below. checkbox filled by itext

the way the checkbox filled is different across acrobat and itext. is there a way to make the itext fill the checkbox similar to acrobat and make it bold.

I'm using the following code to fill the checkbox.

PdfReader reader = new PdfReader(src);
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest));
AcroFields form = stamper.getAcroFields();

form.setField("cb1", "Yes");

stamper.setFormFlattening(true);
stamper.close();

Thanks.




Aucun commentaire:

Enregistrer un commentaire