Free Support Forum - aspose.com

Issue of access a pdf form fields which is generated from xml

Hello Support-Team,



I have implemented aspose.pdf in sample web application. Sample web
application generates a PDf document from xml file. now i want to fill a
data in existing pdf document but When existing pdf document is
accessed by using Aspose.Pdf.Facades.Form class to fill a data,
FieldNames property shows only submit button field but pdf document also
contains textbox which is not populated in FieldNames property of
Aspose.Pdf.Facades.Form class.



I have also mentioned code as below, same way i have implemented in sample project.



Content.xml

<?xml version="1.0" encoding="utf-8" ?>



<Table ColumnWidths="135" DefaultCellPaddingTop="2"
DefaultCellPaddingLeft="0" DefaultCellPaddingRight="0"
DefaultCellPaddingBottom="2">



Full Name










Aspx page contains below code to generate a PDF document.

Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(Server.MapPath(".") + @"\Content.xml");
pdf.BindXML(xmlDoc, null);

string pdfFile = @"C:\PDF\Form.pdf";
pdf.Save(pdfFile);

FormEditor formEditor = new FormEditor();
formEditor.BindPdf(pdfFile);

formEditor.AddSubmitBtn("submitbutton", 1, "Submit", "http://localhost/PDFGeneration/PostData.asmx/SubmitData", 100, 450, 150, 475);

string pdfFileUpdated = @"C:\PDF\UpdatedForm.pdf";
formEditor.Save(pdfFileUpdated);

Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();

pdfForm.BindPdf(pdfFileUpdated);

string[] fields = pdfForm.FieldNames;

pdfForm.FillField("Fullname", "Mike");

pdfForm.Save(@"C:\PDF\FinalForm.pdf");

When above code is executed, PDF document is generated but pdfForm.FieldNames contains only "submitbutton" but there should be populated two fields like "submitbutton" and "FullName", so i can't fill a data in "Fullname" textbox.

Secondly, our prime requiremnt is that PDF document should be generated from xml data.

Thanks.

Hi Gaurang,

Sorry for the inconvenience faced. I have managed to reproduce the reported issues on my side. I have logged the issue in our bug tracking system for further investigation and resolution, the issue ID is PDFNEWNET-34712. I have also linked your request to this issue and you will be notified via this thread as soon as it is resolved.

Please feel free to contact us for any further assistance.

<span style=“font-size:10.0pt;line-height:115%;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:Calibri;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>Best Regards,