Using a PDF Creator

There is always a need to create customized documents suited to your organizational needs. These would have to be based and linked to the applications built for your organization, for example, sales invoices, non-disclosure agreements, offer letters, and so on. Studio has a PDF Creator to allow you to create your own custom templates that can be used with different applications by adding them to the workflows.

Let us first have a quick look at this video to understand the process.

The PDF Creator basically involves two steps, create custom templates based on existing templates or design your own template on a blank template. Once this template is ready you can use it within the workflow to generate or create the PDF using dynamic values.

Let us consider a simple scenario to create customized Sales invoices that would be sent by email to the specific customer or user. The PDF Creator is provided under Studio Console. Click PDF Creator and click + (Add) template. There are some ready templates that you can Preview and Use, like License agreement, Non-disclosure agreement, sales contract, and so on. Select the template you need and click Use and enter the name for your template and click Add Template.

Optionally you can also create your new template from a blank page. To create your own template from the Blank page, click Blank and enter the name for your custom template and click Add Template.

add template

If you have selected a ready template you would find that there are different components like text, titles, tables, images and variables already added to the template. You can customize these if you want as per your application.

If you have added a blank template, you would simply get a blank page. You can add the different containers and components to organize your page.

Adding components

To start with, note that the template page has a single + (Add) button at the bottom of the page that allows you to add a new page. Now within the page, you can add the Containers that give you a way to organize the layout of the page. You can choose from the different types of the number of resizable columns available like a single column up to 4 columns. Within this page, you can add the other components like Title, Text, Heading 1, Heading 2, Table, and so on. You can use these to design your page as needed. You can also add an Image to add, for example, your company logo.

Adding header and footer

You can also add the header and footer for each page using the Page settings. Simply toggle the header and footer under Page settings and add the components as per your design. Note that the settings are for the page level only. Hence you need to define the settings for each page separately.

Adding variables

Now when you are designing a template, the main consideration is to use it with your applications. You would typically need data from the Form or screen or even from the sheets. To be able to fetch the data and add it to your template, you need to use the variables. There are two types of variables that you can add to your template, text variables, and photo variables. Text variables are used to add the text, numeric, and other data types. The photo variables allow you to add images.

To add variables to the template as required, under Variables, click the Add button which gives you the option to choose a text variable or a photo variable. You can use these variables in the template by simply adding double curly brackets and adding the variable from the list. Optionally you can also add a new variable within the page by creating it within double curly brackets. It gets added to the variables list.

If you need to add company logos, product images, and so on to your document, you can use the photo variables. For example, if you plan to use the product image into the template with a file that is uploaded from the form, then add the image component and go to Photo settings.

Here you need to choose the Source as variable source and then select the respective photo variable. This variable will add the image uploaded from the form during the PDF generation.

Once your template is ready you can save it. The template needs to be published before it can be used in your workflows. So, click Publish and add an appropriate release note.

Now let us see how the PDF creator generates the PDF dynamically. Consider that you have a form to add product details. On submitting this form you want to generate an invoice that could be mailed to some specific user. Create a workflow that you would link to your screen and select the task Generate PDF and add a self-explanatory Task Name.

Under Template to use, select your Template name. You can also set the custom name for the PDF generated, as by default it is named as PDF Generated underscore timestamp value.

You can also encrypt the PDF by using Set User Password. Toggle on to set the password.

It is now necessary to configure the variables by using the data option to fetch the appropriate values. If you want to use the form controls to link to the variables in the template select the appropriate controls under Tasks > Initiated.

Click Done and your task is ready. So here you would be passing the form values to use when the PDF is generated.

To use the PDF generated, you can use another task like an email task to send the PDF generated to the specified user as an attachment. Provide the task name and select the user to send an email to. Enter the subject and email body. Now we want to add the file as an attachment. It can be accessed through the data option as the .PDFLINK, where the workflow name is the name of the Generate PDF task created earlier. Click Done. Now the workflow is ready.

Now, whenever you submit your form the Invoice would be generated in PDF format and sent to the specified email as an attachment. You can now see the PDF Created based on the template. It has all the values and images submitted from the form.

You can thus use the PDF creator to design your own templates and use them as per your application demands.