.net - C# 或 .net 中是否有任何 API 可以编辑 pdf 文档?

标签 .net api pdf pdf-generation

关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。












想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。

8年前关闭。




Improve this question




C# 或 .net 中是否有任何 API 可以编辑 pdf 文档?就像我需要检索特定文本并将其替换为我自己的文本。

谢谢
nRk

最佳答案

这是不可能的(以干净可靠的方式),来自 iTextSharp tutorial :

You can't 'parse' an existing PDF file using iText, you can only 'read' it page per page. What does this mean? The pdf format is just a canvas where text and graphics are placed without any structure information. As such there aren't any 'iText-objects' in a PDF file. In each page there will probably be a number of 'Strings', but you can't reconstruct a phrase or a paragraph using these strings. [...] You can't edit an existing PDF document, by saying: for instance replace the word Louagie by Lowagie. To achieve this, you would have to know the exact location of the word Louagie, paint a white rectangle over it and paint the word Lowagie on this white rectangle. Please avoid this kind of 'patch' work. Do your PDF editing with an Adobe product.

关于.net - C# 或 .net 中是否有任何 API 可以编辑 pdf 文档?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1781208/

相关文章:

java - 新的java.io.IOException : Call requires API level 9

javascript - 使用 pdf.js 渲染 pdf 时如何重新设置单词样式?

c# - Visual Studio 2008 .Net - 跨过当前进程

c# - .NET 中的可空类型

c# - 在 C# 中检测 XML 片段

php - 使用 Shopify API 更新 Shopify 密码

c# - 有人可以将 C# "HttpWebRequest"转换为 VB6 吗?

javascript - 如何在 iframe 中禁用 pdf 工具栏下载按钮

javascript - pdf.js 从 Uint8Array 打开或生成 pdf

c# - 如何将非 bool 属性绑定(bind)到 bool 属性