关闭。这个问题不满足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/