I have a template pdf with 2 PushbuttonField, what I want is , If an Image is very small, to not resize it, I have try to use setProportionalIcon(false);
but It doesn't work, here my code:
PdfReader reader = new PdfReader("C:/Users/Desktop/template.pdf");
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream("C:/Users/Desktop/result.pdf"));
AcroFields form = stamper.getAcroFields();
PushbuttonField ad = form.getNewPushbuttonFromField("first");
ad.setLayout(PushbuttonField.LAYOUT_ICON_ONLY);
ad.setProportionalIcon(true);//or false but doesn't work
ad.setImage(Image.getInstance("C:/Users/Desktop/first.jpg"));
form.replacePushbuttonField("Fronte", ad.getField());
PushbuttonField ad1 = form.getNewPushbuttonFromField("second");
ad1.setLayout(PushbuttonField.LAYOUT_ICON_ONLY);
ad1.setProportionalIcon(true);//or false but doesn't work
ad1.setImage(Image.getInstance("C:/Users/Desktop/second.jpg"));
form.replacePushbuttonField("Retro", ad1.getField());
stamper.setFormFlattening(true);
stamper.close();
reader.close();