-
Notifications
You must be signed in to change notification settings - Fork 214
Open
Labels
bugSomething isn't workingSomething isn't working
Description
PDFsharp/src/foundation/src/PDFsharp/src/PdfSharp/Pdf.Signatures/PdfSignatureHandler.cs
Line 156 in 6aacefa
| Document.Pages[Options.PageIndex].Elements.Add(PdfPage.Keys.Annots, new PdfArray(Document, signatureField)); |
Using .Add(...) throw an exception when the /Annots key exists.
I stumbled upon some PDF documents generated by www.princexml.com that has the /Annots key present in this dictionary, but the reference PDF object does not exist, in PdfSharp this gives a null value for the /Annots key in the dictionary.
For example the /Annots element references an object '70 0 R' but there is no element with this reference in the document.
Leading to .Add(...) throwing an exception.
Simple fix is to use the indexer of the dictionary to overwrite the value instead of throwing:
KDS@233b486
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working