Arclab® Web Form Builder
Create Custom PDF Email Attachments Using TCPDF or FPDF
Create Custom PDF using TCPDF or FPDF
Arclab Web Form Builder allows you to create custom PDF documents automatically when a visitor submits a web form. Using the PHP libraries TCPDF or FPDF, you can generate personalized PDF files containing information entered by the user and attach them to the emails sent by your form. This feature is particularly useful when you need to generate documents such as invoices, order confirmations, contracts, registration confirmations or application summaries based on submitted form data. The program already provides a basic PHP framework for both TCPDF and FPDF. You only need to add your own PHP code to define the content and formatting of the PDF document.
Generate PDF Email Attachments Automatically
PDF documents can be created as part of the form submission process. Arclab Web Form Builder allows you to execute custom PHP code using individual submission tasks. You can add a task that generates the PDF document before the email is sent. Once the PDF has been created, it is automatically attached to the subsequent emails generated by the form. This makes it possible to automate document creation and email delivery in a single workflow. For example, an order form can generate a personalized order confirmation containing the customer's details and order information and send it as a PDF attachment.
Create Custom PDF Email Attachments
Generate personalized PDF documents, such as invoices or contracts, using submitted form data. Automatically attach the generated PDF to email notifications or autoresponders.
Insert Submitted Form Data into PDF Documents
Your PDF documents can contain both predefined text and information
entered by the visitor in the web form. Arclab Web Form Builder
provides access to the submitted form fields through PHP variables.
These variables are displayed directly in the program's code
editor and can be inserted into your custom PHP code by simply
clicking on the corresponding field name.
You can use
these values to populate your PDF documents with customer names,
addresses, order details, registration information or any other
data collected through the form. This allows you to create personalized
documents based on each individual form submission instead of
using the same static PDF file for every visitor.
Insert Submitted Form Data into PDF Documents
Your PDF documents can contain both predefined text and information
entered by the visitor in the web form. Arclab Web Form Builder
provides access to the submitted form fields through PHP variables.
These variables are displayed directly in the program's code
editor and can be inserted into your custom PHP code by simply
clicking on the corresponding field name.
You can use
these values to populate your PDF documents with customer names,
addresses, order details, registration information or any other
data collected through the form. This allows you to create personalized
documents based on each individual form submission instead of
using the same static PDF file for every visitor.
Choose Between TCPDF and FPDF
Arclab Web Form Builder provides a basic PHP framework for two popular
PHP libraries used to generate PDF documents.
You can choose the
library that best matches your requirements and the complexity of your
PDF documents.
TCPDF
TCPDF is an open-source PHP library for generating PDF documents. It supports text, HTML content, images, tables, fonts and various other PDF elements. It is suitable for creating more sophisticated documents such as invoices, contracts and detailed reports. You can download TCPDF from the official TCPDF website or install it using Composer.
FPDF
FPDF is a lightweight PHP library that allows you to generate PDF files directly with PHP. It provides functions for adding text, images, lines and other elements to a PDF document and is well suited for straightforward document layouts.You can download FPDF from the official FPDF website or install it using Composer.
Customize the PDF Content and Layout
The provided PHP framework takes care of the basic PDF generation process. You define the actual document content and formatting by adding your own PHP code. This gives you control over the appearance and structure of the generated PDF files. You can add headings, text, tables, images, logos and dynamic form values to create documents that match your individual requirements. The same form can generate different PDF documents depending on the submitted information and the PHP code you implement.
PHP Library Installation on Your Web Server
The corresponding PHP library, TCPDF or FPDF, must be available on your web server to generate PDF documents. You can download the library from its official source and upload the extracted files to a folder on your web server. Alternatively, you can install the library using Composer if your hosting environment supports it. Once the library is available, you can configure the provided PHP framework in Arclab Web Form Builder and add your custom PDF generation code. Make sure that the PHP include path points to the correct location of the library on your server.
How to Create a PDF Email Attachment
Arclab Web Form Builder provides step-by-step instructions and sample PHP code for both PDF libraries. The examples show how to include the library, access submitted form values, generate the PDF document and return its contents as an email attachment.
See the corresponding instructions in the User Manual:
- Create a PDF File using TCPDF and Add it as an Email Attachment
- Create a PDF File using FPDF and Add it as an Email Attachment
Please note that creating custom PDF documents requires basic
PHP programming knowledge.
The provided examples and framework
make it easier to integrate your own PDF generation code into the form
submission process.
The custom PHP code submission task is available
in the Test Version, Professional Edition and
Developer Editions of Arclab Web Form Builder.
