以编程方式查找和替换pdf中的文本 [英] Programmatically find and replace text in pdf

查看:81
本文介绍了以编程方式查找和替换pdf中的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个网络脚本,该脚本将允许我更改已上传的PDF模板并重新输出它们.我已经尝试过Zend,它允许我写PDF,但这意味着在某些空间中将PDF留空,这对于我的需求而言是原始的. PDFFlip并没有更好.

I'm trying to create a web script that will allow me to alter PDF templates that I have uploaded and re-output them. I have tried Zend already which allows me to write to a PDF but that means leaving the PDF blank in certain space which is to primitive for what I need. PDFFlip was not any better.

我们需要实现功能,以便我们可以从PDF中删除内容以及进行删除和替换.我看过CAM :: PDF和changepagestring.pl,但不确定它是否能胜任工作.我很难找到任何实际的用法示例,而且Perl不是我以前使用过的语言.

We need to implement functionality so we can remove content from the PDF as well as remove and replace. I have looked at CAM::PDF and changepagestring.pl but I'm not sure it's up to the job. I was hard pressed to find any real usage examples and Perl is not a language I have used before.

这是一个Web项目,但是我使用的语言很灵活,最好是PHP或ASP.NET C#.除非没有其他方法,否则最好不要使用Java.

This is for a web project but I am flexible with the language we use, ideally PHP or ASP.NET C# would be great. Preferably not Java unless there is no other way.

我还应该指出,我没有任何运气就浏览了FoxitReader SDK.我从未尝试实现它,但没有发现类似功能的查找和替换.

I should also point out that I looked through the FoxitReader SDK without any luck. I never tried to implement it but I found no mention of find and replace like functionality.

推荐答案

作为解决方法,最好以更舒适的格式保存和填写模板?例如.您可以将模板保留为Microsoft Word模板,然后在填充后将其导出为PDF.此线程可能以这种方式有用

May be as workaround it's better to hold and fill in templates in some more comfortable for editing format? E.g. you can keep your templates as Microsoft Word templates and then export them to PDF after filling. This thread may be useful on this way.

PDF文件格式不太适合编辑.

PDF file format isn't quite appropriate for editing.

作为另一种方法,您可以将模板准备为包含表单字段的PDF.在这种情况下,填写表单字段是常见且众所周知的任务,并且为此存在很多pdf组件.

As another way may be you can prepare your templates as PDFs containing form fields. In this case filling of form fields is common and well-known task and there a lot of pdf components for this.

这篇关于以编程方式查找和替换pdf中的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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