menu-icon
menu-icon
Bit Assist Menu Icon

PDF Attachment

Estimated reading: 7 minutes 290 views

Introducing PDF Attachment

The PDF Attachment feature in Bit Form allows administrators to send emails with PDF attachments, which can be used to share form entry data or other relevant information with recipients. This feature enhances the overall user experience and enables efficient and branded communication with recipients. Administrators have the flexibility to craft their own HTML templates with styles, further enhancing the professional presentation of PDF attachments.

Benefits of PDF Attachment🎁

  • Seamless sharing of form entry data: PDF attachments can be used to share form entry data with recipients, which can help track progress, making decisions, or providing feedback.
  • Visually appealing and informative: PDF attachments can be customized with images, logos, headers, footers, and other elements, which can make them more visually appealing and informative.
  • Efficient and branded communication: PDF attachments can be used to communicate with recipients in a professional and branded way.

note-icon-bit-apps  Note

Note: To use PDF attachments, your PHP version must be at least 7.2

How to use PDF AttachmentπŸ“„

Global PDF Setting βš™οΈ

pdf-setting

To access Global PDF Settings, go to App Settings -> PDF. In the Global Settings section, you can configure the following options:

pdf-setting

1. Paper Size: The admin can select the desired paper size for the generated PDFs. Common paper sizes include A4, Letter, Legal, etc.

2. Orientation: This allows the admin to choose whether the PDF pages should be in portrait (vertical) or landscape (horizontal) orientation.

3. Font Family: The admin can specify the font family to be used in the generated PDFs. Different font families offer various styles and designs for text.

4. Font Size: This option enables the admin to set the default font size for text in the PDF documents.

5. Watermark: A watermark is an image or text that appears faintly behind the main content of a page. The admin can add a watermark to the generated PDFs for branding, security, or other purposes.

image-watermark

Image Watermark Option:

  • Watermark Image: Administrators can upload a custom image by clicking the Upload button that will be used as the watermark for the PDF templates. This image can be a logo, text, or any other visual element that needs to be overlaid on the document.
  • Width and Height: Administrators have the option to specify the width and height of the watermark image. This allows for resizing the watermark to suit the document’s layout and design.
  • Position X (Units in millimeters): Administrators can set the horizontal position of the watermark image on the PDF template using millimeters as the unit of measurement. This allows for precise placement of the watermark.
  • Position Y (Units in millimeters): Administrators can set the vertical position of the watermark image on the PDF template using millimeters as the unit of measurement. This enables accurate alignment of the watermark.
  • Show Watermark Behind the Page Content: Administrators can choose whether to display the watermark behind the page content or on top of it. This option provides flexibility in the appearance of the watermark.
  • Opacity (0-100): Administrators can adjust the opacity of the watermark image, ranging from 0 (completely transparent) to 100 (completely opaque). This feature allows for controlling the visibility and blending of the watermark with the content.

6. Language Direction: This feature allows the admin to choose the writing direction for the text in the PDFs. It can be set to left-to-right (LTR) for languages like English or right-to-left (RTL) for languages like Arabic and Hebrew.

note-icon-bit-appsΒ  Note

Note: The settings in Global PDF Settings will be applied to all PDF templates in Bit Forms. This means that any new PDF templates that you create will use the settings that you have specified.

PDF Templates

email-template

After configuring the Global PDF Settings, return to your BitForm dashboard and choose the specific form for which you wish to enable the PDF Attachment feature.

  • Go to the Settings tab of your Bit Form builder.
  • Click on the PDF Templates tab.
  • Click on the Add New Template button.
  • Enter a name for your template.
  • PDF body:
  • PDF Body: You have the option to utilize the default edition (Tiny MCE) for editing the PDF body, or you can implement your custom template.When opting for a user-defined template, the necessity of using the <body> tag is circumvented. By default, the <body> tag is included and adheres to the following rules if a custom template is used. And follow the rules below for custom template.
<style>
  h1 {
    color: blue;
  }
  p { 
    color: red;
  }
</style>

<div>
  <h1>hello world</h1>
  <p>hello world</p>
</div>
  • Add New Page or divide page: To add a new page or divide the current page in your PDF document, you can make use of the <pagebreak /> tag.

Here’s an example of how you can use the <pagebreak /> tag in your PDF template:

<h1 style="color:blue;text-align:center;">This is a heading</h1>
<p style="color:red;">This is a paragraph.</p>

<pagebreak />

<h1 style="color:blue;text-align:center;">This is a heading</h1>
<p style="color:red;">This is a paragraph.</p>

Override Global PDF Setting:

override-global-setting

By checking this option, administrators can override the global PDF configuration for each template. This allows administrators to customize the PDF settings on a per-template basis, providing greater flexibility and control over the appearance and content of individual PDF templates. The available option is Paper Size, Orientation, Font Family, Font Size, PDF File Name, Watermark, and Language Direction.

PDF File Name:

pdf-file-name

This option allows the admin to set the attachment PDF name. The name will be file_name-entry_id.pdf. The PDF File Name option is not available in the Global PDF Settings. It is only available in the Override Global PDF Settings for each template.

For example, if you set the PDF File Name to “My PDF” and the entry ID is 45, the PDF file name will be “My PDF-45.pdf”.

πŸ“œ Apply Conditional Logic to send the PDF Attachment Template:

conditional-logic

You have to set the conditional logic for when the PDF Attachment Template will be sent. To do this, you will need to:

  • Go to the Settings tab of your BitForm form.
  • Click on the Conditional Logic tab.
  • Click on the Add Conditional Logic button.

Below are some options to consider while setting up the conditional logic:

check-email-notification

⏩ Action Run When: Select “Record Create/Edit” to trigger the action when a new record is created or an existing one is edited.

πŸ”„ Action Effect: Choose “On Form Load” to execute the action when the form is loaded.

🎯 Action Behaviour: You can select “Always” to send the email notification unconditionally or use conditions to send emails based on specific requirements.

β˜‘οΈCheck the Email Notification option from the Additional Actions.

Here are the other fields that need to be set:

select-prf-template

βœ” Email Notification: Select the email template that you created earlier to be used for the notification.

βœ” To: Input the email address where you want to send the email notification. You can also select “Form Fields” to fetch data directly from the front end.

βœ” From: Set the email address from which you want to send the email to recipients.

βœ” CC & BCC fields: Choose the CC & BCC fields if you want to send the notification to multiple email addresses.

βœ” Reply To: Set the email address where the user will send the reply message in response to your email notification.

βœ” Attachment: If there is any file upload field on the form, you can send an attachment along with the email.

βœ” PDF Attachment Template: The admin can select the PDF template that was created earlier to be included as an attachment in the email.

note-icon-bit-apps  Note

At last, you have to configure the SMTP from the App Settings option to make sure that the email will be sent without any spamming. To set the SMTP read the SMTP documentation.

Share this Doc

PDF Attachment

Or copy link

CONTENTS