I have a PDF form template that I need to load and fill out the form, and hide 1 or 2 fields. Everything should happen in stream. I can get the form to load and filled out using the PDF Form object, but not able to hide a field. I know to do that you need to use form editor. Not sure how to do that since the PDF form is not stored on disk and it is in memory stream and I’m already using form object for that. Please advise.
Thanks for contacting support.
Once you have filled the data using Form class, you may consider saving the intermediate output in Stream object and then use the same object to instantiate FormEditor instance.
I have tried that before posting it here but I was not successful. Basically I created a form object and loaded the PDF form from a template, filled out the form, and saved it to a new memory stream. I used the same memory stream and created a form editor object by using the bindPDF methods. I used AnnotationFlags.Hidden to hide the form element, and then saved the formeditor. It did not hide the form element. Not sure what I’m doing wrong.
I think the problem is, once I flatten the field, it is part of the PDF and cannot be hidden with the form editor. Can you flatten and hide a field?
info-16:I think the problem is, once I flatten the field, it is part of the PDF and cannot be hidden with the form editor. Can you flatten and hide a field?
Thanks for sharing the details and sorry for the delayed response.
I have tested the scenario as specified above and I am able to notice that form field is not being hidden. However, in order for us to replicate the issue which you are facing, can you please share the source PDF file so that we can test the scenario at our end. We are sorry for this inconvenience.