微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

新 PdfDocument(PdfReader) 上的 System.InvalidOperationException

如何解决新 PdfDocument(PdfReader) 上的 System.InvalidOperationException

我的同事生成了这个 PDF file

当我尝试使用 new PdfDocument(PdfReader) 打开它时,出现此异常:

system.invalidOperationException:
Data: {System.Collections.ListDictionaryInternal}
    HResult: -2146233079
    HelpLink: null
    InnerException: null
    Message: "Collection was modified; enumeration operation may not execute."
    Source: "mscorlib"
    StackTrace: "   at System.Collections.ArrayList.ArrayListEnumeratorSimple.MoveNext()\r\n   at iText.Kernel.XMP.Impl.XMPnormalizer.MoveExplicitAliases(XMPNode tree,ParSEOptions options)\r\n   at iText.Kernel.XMP.Impl.XMPnormalizer.Process(XMPMetaImpl xmp,ParSEOptions options)\r\n   at iText.Kernel.Pdf.PdfDocument.Open(PdfVersion newPdfVersion)..."

我在 .Net Framework 4.8 下运行 iText

它必须与 pdf 的某些格式有关,但我可以在 Adob​​e Reader 和浏览器中打开它而不会出现问题。任何帮助表示赞赏。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。