我正在尝试用ABCpdf做一些非常简单的事情。我的目标是将页码添加到现有的PDF (通过telerik -PDF导出生成)。
我遇到的问题是,在读取PDF文件并保存后,文件就会损坏。
我的代码:
Doc pdfDocument = new Doc();
pdfDocument.Read(path);
MemoryStream outputMemoryStream = new MemoryStream();
pdfDocument.Save(outputMemoryStream);
pdfDocument.Clear();
Response.BinaryWrite(outputMemoryStream.ToArray());
outputMemoryStream.Close(); 任何建议都将不胜感激。
我使用的是ABCpdf 8。
发布于 2013-02-19 00:16:48
请看我的答案Add page numbers to a Pdf document
这解释了如何在pdf链中添加页码。
查看您的代码,问题似乎是您正在重写内存中的当前文件。尝试在创建具有添加的页码的新文件中读取该文件,如果需要,请删除第一个文档并重命名第二个文档。
https://stackoverflow.com/questions/14876871
复制相似问题