Fill form fields of pre-existing PDF with and without 256-bit password encryption

I read the product description and it talks about “importing” and “exporting” form fields, so I’m not sure it can do what we want to do. We have pre-existing PDF documents created in Acrobat Pro XI; they have simple Text form fields. We’d like to populate the fields programmatically in the manner shown in the pseudo-code below, which gets the fields collection and loops through them, assigning each field’s Value property based on the name of the field.


Some of these PDFs will have been encrypted using Adobe Acrobat Pro 11’s 256-bit password encryption. Can Aspose open, read, and fill the fields on such documents if the program supplies the required passwords?

Thanks


var fields = pdf.GetFormFields();
for (int i = 0; i < fields.Count-1; i++)
{
var fld = (PDFFormField) fields[i];
switch (fld.FieldName)
{
case(“city”):
fld.Value = “Chicago”;
break;
case(“company”):
fld.Value = “Acme Widgets”
break;
case default:
fld.Value = “?”;
break;
}
}
bytes[] populated;
pdf.Save(out populated);

PDFViewer.LoadDocument(populated);

Hi Henry,


Thanks for your inquiry. Yes you can open encrypted PDF passing password to Document(Stream/String input, string password) constrouctor and fill the PDF form as per your logic. In addition to this, please check following documentation link for filling PDF form using XML template along with support of XFDF template and FDF template. Hopefully it will help you to accomplish the task.


Please feel free to contact us for any further assistance.

Best Regards,