The PDF Generator add-on allows you to generate PDF files with the information collected by the forms, and send them as attachment of notification emails.
The PDF Generator add-on uses HTML to format the files' contents, combined with the form fields. To refer the form fields use the structure {field.field-name}
Ex. <p>Your name is: {field.user-name}</p>
We use HTML because it is easy to learn but powerful programming language.
The PDF Generator add-on is accessible through the "Contact > Extensions" menu option.
The initial screen of the "PDF Generator" includes the list of forms where the add-on is being used and a section to integrate the add-on in other forms.
The add on - form integration screen appears by pressing the "settings" or "add" buttons in the initial screen.
The attributes list:
For PDF in Chinese or Cyrillic:
For texts in Chinese, include a <head></head> section after the <html> tag, tag, with a block of styles to import a font file for Chinese characters, as follows:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
@font-face {
font-family: 'Firefly Sung';
font-style: normal;
font-weight: 400;
src: url(http://eclecticgeek.com/dompdf/fonts/cjk/fireflysung.ttf) format('truetype');
}
* {
font-family: Firefly Sung, sans-serif;
}
</style>
</head>
For Cyrillic characters, the header is:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
@font-face {
font-family: 'dejavu';
font-style: normal;
font-weight: 400;
src: url(https://cdn.jsdelivr.net/npm/dejavu-sans@1.0.0/fonts/dejavu-sans-webfont.ttf) format('truetype');
}
* {font-family: dejavu;}
</style>
</head>
To include a page break before some text or content:
Use an inline style tag with the css rule page-break-before: always;
Ex. assuming there is a paragraph in text, and you want to start in a different page of the pdf file:
<p style="page-break-before: always;">
Text here...
</p>
To include the page's break after the paragraph use the CSS: page-break-after: always;