Hello Support-Team,
I have implemented Aspos.PDF in sample web project as mentioned on Working with AcroForms|Aspose.PDF for .NET and generated a PDF document, now I am trying to access form-fields using Aspose.Pdf.Facades.Form
class to update an existing form-field’s value but FieldNames
property doesn’t show any form-fields which is highlighted in brown color in below code.
Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();
Aspose.Pdf.Generator.Section sec1 = pdf1.Sections.Add();
Aspose.Pdf.Generator.FormField combo = new Aspose.Pdf.Generator.FormField();
combo.FormFieldType = Aspose.Pdf.Generator.FormFieldType.Combo;
combo.FieldName = "ACombo";
combo.ChoiceOptions = new string[] { "Red", "Green", "Blue" };
combo.FieldValue = "Red";
combo.FormWidth = 80;
combo.FormHeight = 20;
sec1.Paragraphs.Add(combo);
string pdfFile = string.Format("{0}{1}.pdf", @"C:\PDF\", System.DateTime.Now.ToString("yyyyMMdd hhmmss"));
pdf1.Save(pdfFile);
Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();
pdfForm.BindPdf(pdfFile);
string[] fields = <font color="#A52A2A"><b>pdfForm.FieldNames</b></font>;
pdfForm.Save(@"C:\PDF\FinalForm.pdf");
Thanks