ITextSharp 将文本插入现有的 pdf
The title sums it all.
I want to add a text to an existing PDF file using iTextSharp, however i can't find how to do it anywhere in the web...
PS: I cannot use PDF forms.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我找到了一种方法来做到这一点(不知道它是否是最好的,但它有效)
我希望这对某人有用=)(并在此处发布任何错误)
I found a way to do it (dont know if it is the best but it works)
I hope this can be usefull for someone =) (and post here any errors)
除了上面的优秀答案之外,下面还展示了如何向多页文档的每一页添加文本:
In addition to the excellent answers above, the following shows how to add text to each page of a multi-page document:
这对我有用,包括使用 OutputStream:
This worked for me and includes using OutputStream:
这是一种使用不同 PDF 客户端(Adobe、FoxIt 等)中显示的压模和绝对坐标的方法。
Here is a method that uses stamper and absolute coordinates showed in the different PDF clients (Adobe, FoxIt and etc. )
这是一种打印图像的方法:
取自此处。
对要放在图像上的文本使用不同的图层,并确保使用 GetOverContent() 方法。
Here is a method To print over images:
taken from here.
Use a different layer for your text you're putting over the images, and also make sure to use the GetOverContent() method.