acrofields validation on mobile no taking isd code also in calculating the length of mobile no

38 Views Asked by At

I am using the following lines of code: bos = new ByteArrayOutputStream();

blankStatutoryFormsFolder = CommonUtil.getLocalPath() + environment.getProperty("Blank_Statutory_Forms");

reader = new PdfReader(blankStatutoryFormsFolder + "FORM_11.pdf");
stamper = new PdfStamper(reader, bos, '\0', true);
acroFields = stamper.getAcroFields();

These 4 lines are working fine .Document is getting dowloaded. I want to auto populate the mobile no in the mobile no section of this field .I am using this line of code:

if (employeeResponse.getMobileNo() != null) {
                acroFields.setField("topmostSubform[0].Page1[0].mobile_no[0]", employeeResponse.getMobileNo());
            }

employeeResponse.getMobileNo() is coming as +91-9617447617 which is correct (isd code+mobile no) . But the dowloaded pdf has mobile no field section as +91-961744 . Means it is taking isd code and symbols also in calculating the size of the number .

Can anyone please help me on how to create validation here so that the downloaded pdf contains both isd code + 10 digit mobile number.i.e (+91-9617447617) .

sharing the link of the pdf: https://emerald-brear-93.tiiny.site/

0

There are 0 best solutions below