Unable to fetch all fields Using PDFSharp in .NET #181
Unanswered
Babatunde93
asked this question in
Q&A
Replies: 1 comment
-
Fields may be organized into a hierarchy comparable to the folder-structure on your hard drive. In your case it looks like you have a field-hierarchy like this:
You may access the field seat.tag by using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a pdf with editable form fields that have 10 input fields. Five out of the input fields have name like (age, sex, dob, location, address). The other five have name likes (ticket.id, event.name, seat.row, seat.tag, ticket.eventdate).
`PdfDocument templateReader = PdfReader.Open(templateStream, PdfDocumentOpenMode.Modify);
IDictionary<string, string> fieldVals = mergeItem.MergeFieldValues;
PdfAcroForm form = templateReader.AcroForm;
form.Elements.SetName("/NeedAppearances", "true");
form.Elements.SetBoolean("/NeedAppearances", true);
if (form != null && form.Fields.Count > 0)
{
foreach (string fieldName in form.Fields.DescendantNames)
{
PdfAcroField field = form.Fields[fieldName];
}`
Using
form.Fields.DescendantNames
return the 10 items butPdfAcroField field = form.Fields[fieldName];
only return the fields of (age, sex, dob, location, address).How can i access the other fields?
Beta Was this translation helpful? Give feedback.
All reactions