简体   繁体   English

PDFSharp 丢失注释

[英]PDFSharp losing annotations

Hello I am using the latest pre release version of PDFSharp and I am concatenating several documents.您好,我使用的是 PDFSharp 的最新预发布版本,我正在连接多个文档。 However, when I add the pages it is losing the annotation.但是,当我添加页面时,它会丢失注释。 Any idea why?知道为什么吗?

When I get the file like below, it has the annotation.当我得到如下文件时,它有注释。

PdfDocument inputDocument1 = PdfReader.Open(fromDirectory, PdfDocumentOpenMode.Import);

But, when I go to add it to the overall document, like below, it loses the annotation.但是,当我 go 将其添加到整个文档时,如下所示,它会丢失注释。

page = outputDocument.AddPage(page);

Any help on this would be greatly appreciated!对此的任何帮助将不胜感激!

事实证明,PDFSharp 1.50.4000-beta 3b有一个错误,因此我备份到1.32.3057版,然后开始工作。

To solve this issue, update this code:要解决此问题,请更新此代码:

page = outputDocument.AddPage(page);

To:到:

page = outputDocument.AddPage(page, AnnotationCopyingType.DeepCopy);

This fixed the issue for me.这为我解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM