Posted by a ceTe Software moderator
Hello,
Yes, you can get the dimensions of the form fields in an existing PDF using DynamicPDF Merger for Java product. You will need to load the PDF using PdfDocument class, retrieve the form field dimensions using getWidth and getHeight methods of PdfFormField class. You can refer to the documentation on PdfFormField class members
here. Below is the code sample.
PdfDocument pdf = new PdfDocument("Path for an input PDF");
MergeDocument document=new MergeDocument(pdf);
//Getting Dimensions of the form field.
float width= pdf.getForm().getFields().getPdfFormField("Full form field name").getWidth();
float height = pdf.getForm().getFields().getPdfFormField("Full form field name ").getHeight();
Thanks,
ceTe Software Support Team.