简体   繁体   English

用PHP预填充AcroForms PDF

[英]Pre-fill AcroForms PDF in PHP

Is there any way in PHP how to pre-fill PDF form (AcroForms) and serve it to a user to further editing? PHP中有什么方法可以预先填写PDF表单(AcroForms)并将其提供给用户以供进一步编辑? I cannot use XFA/XDP. 我不能使用XFA / XDP。 It must be the AcroForm which user can edit and save in Acrobat Reader 11. And It is needed to be editable pre-fill. 它必须是用户可以编辑并保存在Acrobat Reader 11中的AcroForm。并且它需要是可编辑的预填充。 So the user can rewrite pre-filled field. 因此,用户可以重写预填充字段。

Hmm… it looks like server-side form filling time today… I just answered a similar question. 嗯……今天看起来像服务器端表格的填写时间……我刚刚回答了类似的问题。

So, in short, IMHO the first choice would be a form filling application, such as FDFMerge by Appligent. 因此,简而言之,恕我直言,首选将是表单填写应用程序,例如Appligent的FDFMerge。 This is a command-line application, and can therefore very easily be controlled using PHP. 这是一个命令行应用程序,因此可以很容易地使用PHP进行控制。 With its result, the user can continue filling, overwriting, and saving (as far as he does not use a crappy PDF viewer). 结果,用户可以继续填充,覆盖和保存(只要他不使用笨拙的PDF查看器)。 And with Adobe Reader XI, saving the filled form is no issue anymore anyway. 而且,使用Adobe Reader XI,再也不必再保存填写的表单了。

Another approach would be crafting an according FDF file and send that to the user. 另一种方法是制作相应的FDF文件并将其发送给用户。 An "accordingly crafted" FDF has a key pointing to the base PDF (the blank PDF). “精心制作”的FDF具有指向基本PDF(空白PDF)的键。 When opening the FDF, and the base PDF is not already open, Acrobat/Reader (down)loads the base PDF and fills it out. 当打开FDF且尚未打开基本PDF时,Acrobat / Reader(向下)将加载基本PDF并填写。 This would be client-side filling. 这将是客户端填充。

There is not much literature around about FDF, but the dry description is in a section of the Portable Document Format reference, which is part of the Acrobat SDK, downloadable from the Adobe website. 关于FDF的文献不多,但简要说明在可移植文档格式参考的一部分中,该参考文件是Acrobat SDK的一部分,可从Adobe网站下载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM