Free Support Forum - aspose.com

Setting a Drop Down in a PDF form

Hi,

We are using Aspose.PDF (version 6.6.0.0) (Runtime Version: .Net 2.0) to use Form-Fill feature of PDF forms. I am using the 2013 i-9 form (http://www.uscis.gov/files/form/i-9.pdf).

1. The State field on Page 7 of the form (form1[0].#subform[6].State[0]) is a drop down field. How can I set the value for the drop down field if I know that the state I want to choose is, for example, WA?
2. When I Fill the Form and save the result document as a new Form and open in Adobe Acrobat Reader, I get the following message:
This document enabled extended features in Adobe Reader. The document has been changed since it was created and use of extended features is no longer available. Please contact the author for the original version of this document.
How can I prevent this message from appearing when someone opens the filled document?
3. How can I save only a partial document? For example, in the above PDF, I only need pages 7 and 8. All the other pages are instructions. The document is password protected.

Thank you.

Hi there,


Thanks for your inquiry. Please check following code snippet for filling drop down field and to preserve extended feature of form as well. Please refer to following documentation link for preserving extended features details/code snippet. And in reference to your last question please also check following documentation links for extracting particular pages from existing Pdf document.


FileStream fs = new FileStream(myDir + “i-9.pdf”, FileMode.Open, FileAccess.ReadWrite);
//instantiate Document instance
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(fs);
//set XFA field value
doc.Form.XFA[“form1[0].#subform[6].State[0]”] = “WA”;
// save changes
doc.Save();

Please feel free to contact us for any further assistance.

Best Regards,



P.S: In reference to your last question about extracting particular pages form a password protected Pdf document. You have to open the file using a Document class constructor, accepts password along with file name. Please check the details here.