We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a893d5 commit 7e2c39dCopy full SHA for 7e2c39d
src/core/iTextSharp/text/pdf/AcroFields.cs
@@ -1747,8 +1747,8 @@ virtual public bool RemoveField(String name, int page) {
1747
continue;
1748
PdfIndirectReference refi = item.GetWidgetRef(k);
1749
PdfDictionary wd = item.GetWidget( k );
1750
- PdfDictionary pageDic = reader.GetPageN(pageV);
1751
- PdfArray annots = pageDic.GetAsArray(PdfName.ANNOTS);
+ PdfDictionary pageDic = reader.GetPageN(pageV); //Returns null in case of floating, orphaned fields
+ PdfArray annots = pageDic != null ? pageDic.GetAsArray(PdfName.ANNOTS): null;//Account for floating, orphaned fields
1752
if (annots != null) {
1753
if (RemoveRefFromArray(annots, refi) == 0) {
1754
pageDic.Remove(PdfName.ANNOTS);
0 commit comments