I am trying to fill a field of PDF using Aspose.Pdf, and then I would like to flatten the PDF so it is not editable when saved. I have tried the following in my code:
TextBoxField customerNumber = (TextBoxField) form.get(“Customer Number”);
customerNumber.setValue(“111”);
customerNumber.flatten();
When the flatten() method runs, the program hangs. The method never completes, and I cannot figure out why. If I do not set the value of the field before flattening, the flatten() method works fine. Is there something I am doing wrong?