Attaching a PDF File to a Form

You have successfully completed the installation and activation of both, the WPForms and PDF Forms Filler for WPForms plugins. Assuming you’ve already created a form using WPForms and have a corresponding PDF file ready for attachment to the WPForms form, let’s proceed with the next steps.

  1. Navigate to the WPForms form you wish to modify and enter the editing mode.
  2. Head to the Settings screen and select the PDF Forms tab.
WPForms PDF Forms Tab

  1. In the opened window, locate and click the Attach a PDF File button. This action will prompt the WordPress Media Library browser to appear. From there, choose your desired PDF file – either by selecting an already uploaded one or uploading a new one – and then click the Select button to proceed.
Attaching PDF File from Media Library

  1. After successfully attaching your PDF, it will promptly appear in the attached files list. Next to each file, you’ll find two buttons offering distinct functionalities. By selecting the Options button, you can access a dropdown menu showcasing various options applicable to the file. The Delete button allows you to detach the file from the document.
Attached PDF Files List with Options

Each attached file has a unique attachment [ID] specified in front of the file name. This information can be useful when mapping fields. This numeric ID corresponds to the identifier of the PDF file in the WordPress’s Media Library. Take care not to delete this file from your Media Library, otherwise your attachment will no longer function.

File Options

Skip when empty

Sometimes it makes sense to ignore the PDF file when none of its fields are filled and no image is embedded into it. In other words, if the user has submitted a form with empty fields, then there is no point in attaching the file to an email or generating a file to download it. If this option is enabled and no information (or blank information) is filled into the PDF file then the file is not attached to any email message, no download link is provided to the user and the PDF is not saved in the wp-content/uploads folder.

Flatten

This option allows the flattening of the PDF form after it is filled. This removes the form fields from the generated PDF file and ensures that the PDF appears static to the user in their PDF viewer.

New filled PDF file name

Sometimes it is useful to specify a custom filename for your filled PDF file that will be attached to the email messages, downloaded by the user and/or saved in the wp-content/uploads directory. If you leave this field blank, the original attachment filename will be used. Smart tags can be used as part of the filename. Smart tag content will be sanitized before being used in the filename.

Path for saving filled PDF file

In some situations you want to save the filled PDF files on the web server. This option allows you to save your filled PDF files somewhere in the wp-content/uploads directory. Smart tags can be used as part of the path. Click the Show Smart Tags button to see the available smart tags. You have to make sure to use smart tags that provide a unique path and/or filename. For example, if you use my-pdfs/{unique_value} (as shown in the Attached PDF Files List image above) then your filled PDF files will be uploaded to wp-content/uploads/my-pdfs/#####/ (where ##### would be a unique value).

Ensure a unique path and filename combination for optimal functionality. If a file with a matching name exists, a numerical identifier will be appended, potentially causing unexpected outcomes, for example, if the download link always points to the document.pdf file then it will not be pointing to the correct file because the actual filename will be document-1.pdf.

This parameter is useful if you need to give the user the ability to download a PDF file after submitting the form. A link to download the filled PDF file will be provided alongside the confirmation. Leave the field blank if you do not want to provide a download link.

Attach the filled PDF file to the following notifications

The completed PDF file can be attached to any notification. For example, in order to send different PDF files to the admin and the user, you need to create notifications for the admin and the user. In the options of each attached file, in the Attach the filled PDF file to the following notifications field, select the appropriate notification.

Notification Attachment Settings