Form to PDF

This plugin was made so forms can be quickly and simply created in WordPress, from which you can generate a PDF document after filling it out. For PDF generation, the plugin uses the mPDF package. To generate the Excel spreadsheet, the plugin uses the PhpSpreadsheet package.

The plugin – no matter the setup – will notify the site administrators and other recipients in email for the filling of the form, which can include the filled fields. (You can also set the notification to be sent to the email address filled in the form.) Although it matters from the setting, if the complete PDF document will be generated by the plugin and opened in the filling browser (It loads it in a popup window.)

Usage in 4 simple steps

  1. Defining the form
    The form itself is stored by a simple HTML file in the folder specified through the settings, where the <form_name>.html file is to be the displayed form. (It can include every HTML forming and javascript codes.) The input fields can be defined in the data types page as shown and can be formed in the data parameters page.
    By clicking here, you can download a sample, which includes all data types.
  2. Defining the content of the notifier email

    The plugin sends a notification to every administrator of the site of the filled out form, if the plugin is set that way. (This is the default.) This email’s content can be individually set and can include the data shown on the form. This definition file must be created under the name <form_name>.email.html.
    By clicking here, you can download a sample, which includes all data types.

  3. Defining the PDF document
    The plugin uses an HTML sample to convert the given data in the form into a PDF and displays it to the user filling the form out in a browser window. (Optional, this is the default.) The PDF document’s content can be varying from here. This PDF definition file, with the HTML format must be created under the name <form_name>.pdf.html.
    By clicking here, you can download a sample, which includes all data types.
  4. Attach to the content
    Attach the reference of the form into the content to the correct location with the help of the code below:
    [form-to-pdf form="<form_name>"]

You can choose three types of built-in code for the display during the generation of the form: HTML5, Bootstrap 3, Bootstrap 4. Besides this, you can create your own display style to the form-to-pdf/templates folder in the site theme’s folder, where the plugin searches in different folders. (You can create multiple samples.)

You can choose between the samples in the global options, or during the attachment to the form content. In the latter case, attach the form this way: [form-to-pdf form="<form_name>" template="<template_folder_name>"]

The robot is the filter part of the plugin and automatically gets to the end of the form.