Create PDF

Form to PDF

Magyar verzió
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 …

Plugin options

On the page of the plugin setup, the function’s default values can be given. A part of these can be overwritten during the attachment to the form.

The form’s folders
The folder where the form(s) definition files can be found to the main library of WordPress.

Form template

The …

Usable data types

The following data types can be used:

Sample form

[include: http://wpdemo.dovi42.hu/demo/forms/sample-types-en.html] This is Bootstrap 4 sample template

Data protection

This form is provided as a sample only! Do not enter real data!
[INPUT type="hidden" id="hidden" value="Hidden value"]
[INPUT type="text" id="text" value="This is test"]
[INPUT type="password" id="passwd" value="This is test"]
9
Accepted: [0-9] and decimal separator.
[INPUT type="number" id="number" dec="," sep=" " value="123456,7890"]
[INPUT type="date" id="date2" format="Y. F d., l" value="2020-01-01"]
"date" ID already reserved!
[INPUT type="time" id="time2" value="12:00"]
"time" ID already reserved!
[INPUT type="email" id="email" value="info@internet.com"]
Accepted characters: [0-9] + - / ( )
[INPUT type="phone" id="phone" value="(+36-30) 123-4567 / 548"]
[INPUT type="url" id="url2" value="http://internet.com"]
"url" ID already reserved!
[INPUT type="mask" id="mask" mask="999-aaa-www?-***" value="123-abc-a2c"]
Accepted characters:
  • 9 : Numbers only
  • a : Only the English alphabet letters
  • w : Only English alphabet letters and numbers
  • h : Hexadecimal characters
  • * : Any character
  • ? : Optional - The following characters are optional
[INPUT type="textarea" id="textarea" value="Lorem ipsum dolor sit amet, consectetur adipiscing elit."]
[INPUT type="list" id="list" values="0:No|1:Yes|2:Maybe..." value="1"]
Radio:
[INPUT type="radio" id="radio" values="0:No|1:Yes|2:Maybe..." value="2"]
Checkbox:
[INPUT type="checkbox" id="checkbox" value="one" label="This is checkbox" checked]
[INPUT type="switch" id="sw2" text="Yes|No" label="This is simple switch"]
GDPR sample:
[INPUT type="checkbox" id="gdpr" required label="I agree that this information will be used by the site for testing purposes."]
Data processing is in progress

Data fields parameters

The data fields can be parametered as shown below:

Sample form

[include: plugins/form-to-pdf/admin/docs/sample-parameters-en.html] This is Bootstrap 4 sample template

Data protection

This form is provided as a sample only! Do not enter real data!

Icon

[INPUT type="text" id="sample1"]
[INPUT type="text" id="sample2" icon=""]
[INPUT type="text" id="sample3" icon="fa fa-copyright"]

Required

*
[INPUT type="text" id="sample4" required]
*
This is required field!
[INPUT type="text" id="sample5" required invalid="This is required field!"]
The message will appear when the user completes the process.

Value

[INPUT type="text" id="sample6" value=""]
Definitely an empty field.
[INPUT type="text" id="sample7" value="Set the value"]
[INPUT type="text" id="sample7a" value="shortcode"]
[INPUT type="text" id="sample8"]
value = $_REQUEST['sample8']
[INPUT type="text" id="sample9" value="COOKIE"]
value = $_COOKIE['sample9']
In this case, the value is saved when you submit the form.

Other

[INPUT type="text" id="sample5a" readonly]
[INPUT type="text" id="sample10" placeholder="Placeholder text"]
Input description
[INPUT type="text" id="sample11" description="Input description"]
[INPUT type="text" id="sample12" class="my_class"]
<style>.my_class{background-color:#DDFEC7;}</style>
[INPUT type="text" id="sample13" style="background-color: #C6C6FF; border: 2px dotted red;"]
All other key="value" settings.
[INPUT type="text" id="sample13" onclick="my_alert();"]
You can even make a javascript call.
Modifying data through a Javascript function
The HTML template can contain javascript code. An example of its possible use is:
9
[INPUT type="number" id="num1 onkeyup="calculate();"]
9
[INPUT type="number" id="num2" onkeyup="calculate();"]
[INPUT type="number" id="num3" class="text-center" icon="" readonly]

All in one

*
This is required field!
Input description
[INPUT type="text" id="sample14" value="Set the value" class="my_class" onclick="my_alert();" style="border: 2px dotted red;" description="Input description" placeholder="Placeholder text" required invalid="This is required field!" icon="fa fa-copyright"]

Type specific settings

9
[INPUT type="number" id="number" dec="." sep=" "]
dec="" : decimal separator (if not, it can only be an integer)
sep="" : thousands of dividers (if it is not, it is not divided)
Accepted: [0-9] and decimal separator.
[INPUT type="date" id="date" format="Y. F d., l"]
format="" : WordPress date format (i18n)
Use this format for processing! The input format is browser specific.
[INPUT type="mask" id="mask" mask="999-aaa-www?-***"]
Accepted characters:
  • 9 : Numbers only
  • a : Only the English alphabet letters
  • w : Only English alphabet letters and numbers
  • h : Hexadecimal characters
  • * : Any character
  • ? : Optional - The following characters are optional
Data processing is in progress

Other options

Every integer will be available during the PDF generation and the email sample, under the name which you referred to it as.
You can refer to the form’s integers during the creation of the PDF document, and in the email sample. Give the integers’ names converted into capital letters!
Like this: …

Robot filter

You can specify Google reCAPTCHA v2 API keys in the plugin settings. If these keys are provided, Google’s robot filter will be used. By default, and without specifying keys – use the built-in custom filter.
Default filter

Google reCaptcha v2

Sorry, but Google knows better what language area …

Step by step

Use form and to generate a PDF document as follows:

Install the plugin in the usual way.
In the plugin settings, enter the folder in which you want to keep files containing forms. (This folder must already exist. You must be in this folder for the form.)
Where you want to display the form, …

FAQ

How do I set a field input value through Shortcode?

So call the form: [form-to-pdf form=”my_form” my_data=”my_value”]
In the form definition file – my_form.html – so referring to it:
[INPUT type=”hidden” id=”my_data” …

Test the plugin

This form is for the testing and illustration of the plugin.

The system sends an sample letter to the given email below. Please do not fill the remaining fields with real data!

Test form

*
Don't give your real name!
Enter the phone number as you wish!
The test system will send a sample notification letter to this address.
9
You can enter any number.
This is the location of a sample message
Ice cream:
Choose an ice cream!
The Privacy Notice is not part of the test.
Data processing is in progress