I have an intelligent pdf with some buttons and when i click a button i can import from an XML or just show/hide/ add fields.
Can i use spire with c# to trigger that button when i open the pdf?
PdfDocument pdf = new PdfDocument();
pdf.LoadFromFile(path + "F1115.pdf");
PdfFormWidget formWidget = pdf.Form as PdfFormWidget;
var xfafields = formWidget.XFAForm.XfaFields;
foreach (var xfaField in xfafields)
{
if (xfaField is XfaChoiceListField)
{
XfaChoiceListField xfaChoiceListField = xfaField as XfaChoiceListField;
if (xfaChoiceListField.Name == "form1[0].MainForm[0].sbfrmAntet[0].SectorBug[0]")
{
xfaChoiceListField.SelectedItem = ""// you could change the value according to your requirements
};
if (xfaChoiceListField.Name == "form1[0].MainForm[0].SbfrmAddIndicator[0].SursaFin[0]")
{
xfaChoiceListField.SelectedItem = "B. Credite externe";// you could change the value according to your requirements
};
};
};
pdf.SaveToFile(path + "yy.pdf");