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
<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.