有没有在C#或.net任何API编辑PDF文档? [英] Is there any API in C# or .net to edit pdf documents?

查看:374
本文介绍了有没有在C#或.net任何API编辑PDF文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



有没有在C#或.net任何API编辑PDF文档?

就像我需要检索特定的文本,并用自己的文字替换。



Is there any API in C# or .net to edit pdf documents?

Like I need to retrieve particular text and replace it with my own text.

感谢
NRK

Thanks
nRk

推荐答案

这是不可能的(在清洁和放大器;可靠的方式),从的 iTextSharp的教程

This is not possible (in a clean & reliable way), from iTextSharp tutorial:

您不能'分析'现有的PDF文件   利用iText,你只能'看'它   每页页。这是什么意思?   PDF格式是只是一个画布,其中   文字和图形被置于不   任何结构的信息。因此   有不能在任何'iText的对象'   PDF文件。在每一页有将   大概是一个数字的'字串',但   你不能重建一个短语或   使用这些字符串段。 [...]您不能编辑   现有的PDF文档,说:   例如替换词Louagie   通过Lowagie。要做到这一点,你会   必须知道的确切位置   字Louagie,画一个白色矩形   在它和烤漆字Lowagie上   这种白色矩形。请避免   这样的'补丁'的工作。做你的PDF   编辑与Adobe产品。

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.

这篇关于有没有在C#或.net任何API编辑PDF文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆