Skip to content

Navigation Menu

Sign in
Sign up

Improvements for iterating over a PdfAcroFieldCollection #267

SabinPop started this conversation in Ideas
Discussion options

I have noticed some inconsistent behavior when iterating over a PdfAcroFieldCollection.

  1. Iterating using the enumerator returns objects of type PdfItem
  2. Accessing the collection using indexes returns objects of type PdfAcroField

I believe this behavior should be aligned, so the virtual GetEnumerator() method from PdfArray should be overridden in PdfAcroFieldCollection to use the same PdfAcroFieldCollection.CreateAcroField(pdfDictonary) method as in the indexer.

Also, this method doesn't have any reason to be a private instance method, it can be a public static one as it does not access instance data. This would be helpful since we cannot instantiate any PdfAcroField subtype because their constructors are internal.

I would be happy to create a PR for this change.
Let me know your thoughts on this,
Sabin

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /