Free Support Forum - aspose.com

Add fields to existing PDF using Form Editor - Not working

//create an instance of FormEditor class and bind input and output pdf files

var editor = new Aspose.Pdf.Kit.FormEditor("c:\\input.pdf", "c:\\output.pdf");

//create AcroForm fields - I have created only two fields for simplicity

editor.AddField(Aspose.Pdf.Kit.FieldType.Text, "firstname", 1, 100, 600, 200, 625);

editor.AddField(Aspose.Pdf.Kit.FieldType.Text, "lastname", 1, 100, 550, 200, 575);

//add a submit button and set target URL

editor.AddSubmitBtn("submitbutton", 1, "Submit", "http://localhost:45358/TermsPrivacy.aspx", 100, 450, 150,475);

//save output pdf file

editor.Save();

I have used the above code to create a form in an existing PDF, but I dont see the text fields in the output PDF. I have attached both input and output pdf files.

Thanks

-Balaji

Hi Balaji,

I have reproduced this problem at my end and logged it as PDFKITNET-27788 in our issue tracking system. Our team will look into this issue and you’ll be updated via this forum thread once it is resolved.

We’re sorry for the inconvenience.
Regards,