WPForms 的 PDF 表单填写器

描述

此插件允许WPForms用户将包含表单提交数据的PDF附件添加到WPForms的通知和确认中。

如果 PDF 附件包含 PDF 表单,该插件允许用户向 WPForms 表单添加字段和/或将其链接到 PDF 中的字段。该插件还允许将附加的 PDF 文件嵌入由 WPForms 字段提供的图像。填写的 PDF 文件可以保存在网络服务器上。

当您的网站访客提交您的WPForms表单时,PDF文件中的表单会被表单信息填充,图像会被嵌入,并且生成的PDF文件会附加到WPForms通知中。如果在表单选项中启用了此选项,您的网站访客也可以下载生成的PDF文件。

这个插件的特别之处在于它处理PDF文件的方式。它不是从头生成PDF文档,而是修改使用第三方软件准备并提供给插件的原始PDF文档。这使用户能够自由设计他们所需的内容,并使用他们已有的文档。

一个外部网络 API (https://pdf.ninja) 被用于填写 PDF 表单(免费使用有一定限制)。

请参阅Pdf.Ninja 使用条款Pdf.Ninja 隐私政策

Please see the tutorial video for detailed information.

要求:
* PHP 5.5 或更新版本
* WordPress 5.4 或更新版本
* WPForms 1.6.9 或更新版本
* Chrome 63、Firefox 58(或同等版本)或更新版本

已知不兼容的插件:
* Imagify(从PDF文件中删除表单)
* ShortPixel Image Optimizer(从PDF文件中删除表单)

特别感谢以下赞助商对本插件的支持:
* BrowserStack

屏幕截图

  • PDF表单部分可用于访问PDF附件界面
  • PDF附件界面,允许用户附加PDF文件并设置附件选项
  • 字段映射工具,允许用户生成和映射字段、智能标签和数值
  • 图像嵌入工具,允许用户将图像嵌入PDF中
  • 已填写的PDF文件

安装

  1. 安装WPForms插件。
  2. 将此插件的文件夹上传到/wp-content/plugins/目录,或直接通过WordPress插件屏幕安装插件。
  3. 通过WordPress中的“插件”屏幕激活插件。
  4. 开始在设置中的WPForms编辑器中使用“PDF表单”部分。

常见问题

这个插件允许我的网站用户编辑PDF文件吗?

不。这款插件仅在WordPress管理面板中为WPForms界面添加功能。

这个插件是否需要在网络服务器上安装特殊软件?

不。该插件仅使用核心的WordPress和WPForms功能。不需要特殊的软件或PHP扩展。处理PDF文件是通过Pdf.Ninja API完成的。建议使用cURL进行SSL/TLS证书验证。

WPForms表单字段如何映射到PDF表单字段?

字段映射工具允许您单独映射字段,并在需要时即时生成新的WPForms字段。WPForms字段可以映射到多个PDF字段。映射可以与特定的PDF附件或所有PDF附件关联。还可以创建字段值映射,使填充的PDF字段可以用不同于原始填充值的数据填充。

我的字段没有被填充,出了什么问题?

确保映射存在于映射列表中,并且字段名称匹配。

如果您附加了更新的 PDF 文件,并且您的映射与旧的附件 ID 相关联,那么这些映射将被删除,您需要重新创建它们。

有时 PDF 表单字段会有验证脚本,防止填写格式不正确的值。日期 PDF 字段必须使用智能标签格式化

如何在不附加新版本且不丢失附件ID关联的映射和嵌入的情况下更新附加的PDF文件?

尝试使用Enable Media Replace 插件在媒体库中原地替换 PDF 文件。

我的复选框和/或单选按钮没有被填充,出了什么问题?

确保您的 PDF 复选框/单选按钮字段的导出值与 WPForms 表单的复选框值匹配。通常,它是“On”或“Yes”。如果您需要在 WPForms 表单中显示不同的值,则需要创建一个值映射。

WPForms允许您使用多选复选框,但是,PDF文件中的复选框字段不能有多个值。您需要在PDF中改用列表框,或者重命名复选框,使每个复选框都有唯一的名称,然后适当地映射它们。

某些PDF查看器在某些PDF文件中无法正确渲染复选框。您可以通过在不同的PDF编辑器中重新创建PDF来解决此问题。如果您仍在使用Pdf.Ninja API v1,切换到v2可能会解决您的问题。

如何去除已填写的PDF文件中的水印?

请参阅Pdf.Ninja API 网站

评价

2024 年 6 月 23 日 1 回复
I gave it a full day of testing, checkmarks and radio buttons are problematic specially when you have multiple out there it do not render it correctly. Then there is a watermark so its useless.
2023 年 11 月 13 日
It’s not the simplest UI to figure out, but once you do, it gets the job done. Step 1: Create a document (Word, or otherwise) that you need to place form data into.Step 2: Use a PDF application to convert it to PDF and ideally automatically add PDF form fields to it; these are what the plugin will read for mapping purposes. (Recommend using FoxIt PDF Creator for this.)Step 3: Upload the freshly minted PDF to your library.Step 4: In your WPForms form “Settings” tab, select “Step 1: Create a document (Word, or otherwise) that you need to place form data into.Step 2: Use a PDF application to convert it to PDF and ideally automatically add PDF form fields to it; these are what the plugin will read for mapping purposes. (Recommend using FoxIt PDF Creator for this.) Pro-Tip: Make sure to change the font and font size of these auto-generated form fields so that they are more legible than if you leave the font size set to “auto”. I typically choose the font and font size that matches that used in creating the form for best results.Step 3: In your WPForms form “Settings” tab, select “PDF Forms” and click “Attach PDF file.” Upload your PDF.Step 4: Map existing WPForms form fields (left side) to “PDF field” (right side). If you’re doing multiple forms, I recommend selecting the PDF field (on the right) that has the bracketed [] numbers next to them. These numbers match the bracketed number above where you attached the PDF. This helps to keep straight which documents you’re mapping what fields to.Step 5: If you have any images or signatures to map, you’ll do this using the “Image Embedding Tool” section below the field mapping. Pick your field to map to which document, click “Embed Image,” and then draw where you want the image to be embedded (ie a signature line).You’re done except to test it’s all working. For $92 for the Pro version of PDF.Ninja to get rid of the watermark, it’s worth it. Or if you don’t mind the added watermark, use the free version! Emailed back and forth with Alex, the developer, several times. Excellent guy. Very helpful. Thank you so much for an awesome solution. Only feedback I have is I wish it handled certain WPForm fields better, like Address fields and Name fields that are segmented instead of all in one, and radio buttons. Also, handling dates is a bit clunky and could be made more user-friendly. I also wish there was the ability to embed uploaded PDFs into the PDF created, such as in the case of electronically “stapling” a voided check the user scanned in as a PDF to the form you’re having them fill out. (Just got an email from Alex: This is coming!) Disclaimer: Did not test paragraph text, dropdowns, number sliders, website/URL, password, rich text, ratings, Likert scale, Net Promoter Score, or any of the Payment-type fields. Your mileage may vary.
阅读所有4条评价

贡献者及开发者

「WPForms 的 PDF 表单填写器」是开源软件。 以下人员对此插件做出了贡献。

贡献者

更新日志

1.3.1

  • Release date: May 21, 2025

  • Fixed the issue of {entry_id} smart tag not working correctly

1.3.0

  • Release date: April 2, 2025

  • WARNING: This version includes changes that may affect plugin behavior. Please test your forms thoroughly after updating.

  • Fixed an issue with smart tags rendering: smart tag values were HTML-escaped when we need plain text
  • Field Mapper Tool UI issue fixed (column widths).

1.2.0

  • Release date: February 25, 2025

  • WARNING: This version includes changes that may affect plugin behavior. Please test your forms thoroughly after updating.

  • Switched from wpforms_process action to wpforms_process_after_filter filter for filling PDFs to fix an issue with file upload fields
  • Switched from using form submission raw data ($_POST) to formatted field data for filling PDFs
  • Fixed an issue with file upload URL not being accessible with non-smart-tag mappings
  • Fixed a bug with multi-selectable field detection
  • Temporarily added PDF as a supported image format for embedding (until capabilities feature is implemented)
  • 其他小修复和改进

1.1.11

  • Release date: December 28, 2024

  • Added ‘delete all value mappings’ button

  • Fixed value mapping dropdowns going off-screen caused by very long PDF field option labels
  • Fixed localization issues
  • 更新了语言文件
  • Other bug fixes and improvements

1.1.10

  • 发布日期:2024年11月11日

  • 小修复

1.1.9

  • 发布日期:2024年10月3日

  • 错误修复

1.1.8

  • 发布日期:2024年5月30日

  • 添加了映射到文本字段时的多选项连接功能

  • 修复了在自定义值未正确加载时,值映射的WPForms字段下拉菜单中的一个错误
  • 添加了对WPForms多选字段的选项“值”设置的支持
  • 修复了当选项列表元素为字符串时发生的自动值映射生成问题
  • 修复了一个问题:智能标签字段映射中的多余行和空格导致值映射不匹配
  • 其他小改动

1.1.7

  • 发布日期:2024年1月16日

  • 在确认下载时删除了不必要的文件名前缀

  • 修复了由于请求边界中的非字母数字字符导致的API通信可能出现的问题
  • 其他小修复和改进

1.1.6

  • 发布日期:2023年11月9日

  • 修复了页面快照代码中的问题

  • 改进了远程附件支持
  • 修复了图标文件
  • 自动调整智能标签文本区域大小
  • 修复了在某些情况下文本附件选项未保存的问题
  • 其他小修复和改进

1.1.5

  • 发布日期:2023年8月9日

  • 修复了由于异步通知导致的通知附件失败问题

  • 修复了导致生成过多页面快照的问题
  • 小错误修复和改进

1.1.4

  • 发布日期:2023年6月22日

  • 修复了一个错误:表单设置有时不会保存

1.1.3

  • 发布日期:2023年5月17日

  • 添加了一个解决方法,以应对某些非GNU系统上不可用的GLOB_BRACE标志

1.1.2

  • 发布日期:2023年5月6日

  • 错误修复和改进

1.1.1

  • 发布日期:2022年12月2日

  • 确保支持WPForms 1.8.0

  • 次要警告信息澄清

1.1.0

  • 发布日期:2022年12月2日

  • 一些修复影响了填写过程的逻辑。更新后请检查您的表单,以确保一切按预期工作,如果您认为它们可能受到影响!

  • 修复了一个问题,即PDF字段未能在CF7字段值为空时被清除(影响原始PDF文件中的预填充字段)

  • 修复了一个问题:值映射被递归应用(影响具有匹配的CF7/PDF值的字段值映射)
  • 错误修复:值映射无法处理空值
  • 改进了空值映射选项的标签
  • 改进了影响动作检测的PDF附件
  • 修正了德语翻译
  • 更新了语言文件
  • 其他修复和改进

1.0.0

  • 发布日期:2022年9月9日

  • 初始版本