Introduction

Introduction

Note: These features are part of the Visforms Subscription and are not included in the free Visforms version.

Creating PDF documents with Visforms is a very powerful feature.

With the PDF feature you can:

  • Design as many PDF templates as you like for a form, from which the PDF documents are later created.
  • Embed the form data and any other data from the database in the PDF templates as placeholders, which are filled with the specific data when printed.
  • Have the PDF files created from the designed PDF templates and use them in several areas:
    • After submitting the form.
    • In the data views in the frontend.
    • In the edit view of the PDF template in the administration.

PDF in form submission, frontend and administration

You can use the PDF templates you have created to create PDF documents in emails, in the frontend and in the administration.
The overview also includes the locations of the respective configuration.

  • Sending the form with subsequent further processing of the form data.
    • PDF document as a download link in the result text.
      Settings: Form configuration, Result tab.
    • PDF document as an email attachment.
      Settings: Plugin Email attachments.
      Settings: Form configuration, Email attachments tab.
      Settings: Form configuration, Edit email attachments tab.
  • In the frontend
    • Create PDF documents in the data views in the frontend
      Settings: Form configuration, Data display in the frontend tab.
      Settings: Form configuration, Form permissions tab.
      • Permission: Create PDF file in the frontend.
      • Permission: Create PDF file from your own data in the frontend.
  • In the administration
    • Create PDF documents in the edit view of the PDF template
      • Settings: PDF template configuration, tab Preview.

From simple to sophisticated

A simple yet appealing PDF template can be created quickly with a little HTML knowledge. A sophisticated PDF template with a complex design is also possible and of course requires more effort and more in-depth HTML knowledge.

Depending on the use and the demands on the data, a PDF template can be as complex as you like. Particularly when additional data from other tables or embedded data lists are involved.

A rough guideline for effort and complexity from simple to complex:

  • Design the PDF template and insert form data.
  • Design the PDF template in great detail.
  • Additionally embed individual data from other tables.
  • Additionally embed entire data lists from other tables.

In the case of printing several form data sets at once, from simple to complex:

  • Repeat the PDF template as a whole with optional automatic page break after each data set.
  • PDF template in which only a small embedded HTML part is repeated per data set.

Note: In many cases, a PDF template that has been created once can be used to print just one data record (for example as an email attachment in the email after the form has been submitted) or multiple data records (for example all of a user's form submissions in the data view).

The number of data records

There is an important point to note when using PDF templates.

It is about the number of data records that are used to create the finished PDF document from the selected PDF template:

  • There is exactly 1 data record.
  • There are several data records.

There is exactly 1 data record

The creation of the PDF document is based on exactly 1 data record with the submitted form data. The content of the PDF template is processed exactly 1 time.

Note: It is possible to insert a manual page break into the PDF template.

This situation occurs in the following cases:

  • In the frontend
    • Sending the form with subsequent generation and further processing of the PDF document in one of the following forms:
      • PDF document as a download link in the result text.
      • PDF document as an email attachment.
    • Printing a single form record in the data view in the frontend.
  • In the administration
    • Printing in the edit view of the PDF template on the tab Preview:
      • If you select the Record ID option on the Preview tab.
        Only one data record matching the selected data record ID is printed.
    • If you set the numerous filter options and selection options so that only 1 data record remains.

There are multiple data records

The PDF document is created based on multiple data records with submitted form data. The content of the PDF template is processed multiple times, i.e. once per data record. The data records used can be selected in different ways.

Note: Whether a new page is started for the next data record is determined by the Single page per data record option on the PDF settings tab in the PDF template.

This situation occurs in the following cases:

  • In the frontend
    Print in the data view in the frontend of all displayed form data records.
    All records configured by the display filters are used as follows:
    • All records that match the filter settings (i.e. all filtered records).
    • The list position in the case of list navigation has no influence.
  • In the administration
    Print in the edit view of the PDF template on the tab Preview.
    The data records used can be selected in various ways with any degree of precision on the tab Preview and in conjunction with the tab Data-selection.

It is best to read the entire PDF documentation from start to finish

This part of the documentation is an introduction to a very powerful but technically more or less demanding feature. This introduction contains all insights and all necessary information about how the PDF documents work with Visforms.

Once you’ve created your first PDF template or two, you’ll find the work easy. There are hardly any limits to the possible applications and the possible dynamic content of your PDF templates. Simple PDF templates are easy to create.

Note: We recommend that you read this part of the documentation completely from beginning to end.

PDF files are created from PDF templates

PDF templates are created for a specific form. A PDF template is text formatted in HTML.

The PDF template consists of up to three individual HTML texts:

  • Page HTML
  • Page Header HTML
  • Page footer HTML.

The HTML may contain specially formatted placeholders that will be replaced with actual data at runtime.

Possible parameter replacement data includes:

  • the form data of a transmission,
  • the form data of all or selected transfers,
  • the form data of other forms,
  • any data from the database,
  • field parameters,
  • form parameters,
  • user information,
  • Content document information such as current page number and printing date,
  • Control instructions like
    • Document formatting, such as ‘New page after’,
    • Instructions for loops and iterations.

The replacement of the placeholders in the PDF template can also be done recursively. This makes lists as PDF documents possible, which show all orders from the current year for all customers, for example. Each customer can have a page break to a new page beginning with customer information.

The places marked for iteration are treated as follows in the PDF template:

  • copied,
  • replaces the included placeholders and
  • progressively appended to the PDF document.

Which data records are automatically used also depends on the deployment site.

A distinction is made whether the finished PDF document is generated

  • from the frontend or
  • from the administration.

After the placeholders in the PDF template text have been replaced, a PDF document is generated from the HTML using the Library TCPDF.

Create, test and use PDF templates

Visforms supports you with flexible placeholders, powerful tools for replacing the placeholders and an extensive SQL-based record selection.

You manage the PDF templates in the Visforms Administration with the following options

  • generate,
  • test and
  • use directly.

PDF templates can be used directly in the administration via the corresponding buttons in the button bar. In this case, you also have very flexible tools for selecting the data records that are to be used to actually create the PDF document from the PDF template.

However, PDF templates can also be used by the users of your website in the front end. For example, users of your website can download PDF documents with the data that they have submitted in forms in the front end.

Editing PDF templates is similar to editing fields

Basically, creating PDF templates works the same way Visforms works in general. Just as a form has several fields, a form can also have several PDF templates. What you know about editing the Visforms fields in relation to a form also applies in principle to the Visforms PDF templates.

PDF templates are bound to a form

Note: Some settings, such as those on the "General" and "PDF Settings" tabs, are largely self-explanatory and will not be discussed further here.

You are already familiar with the concept from the form fields.

So you can only manage PDF templates if you

  • are in the configuration of a concrete form or
  • are in the form overview list.