gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 11:32:22 26 4
gpt4 key购买 nike

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

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com