PDF Generator documentation
The PDF Generator Extension allows Gravity Flow administrators to add simple PDF generation steps at any point in the process.
The PDF template is designed just like a notification with merge tags and is generated the moment the step is triggered. The PDF Generator step is configured just like every other step with support for conditional logic, scheduling and sending by email as an attachment.
It's intended to provide a quick way to create PDFs from entries without having to edit any configuration files. The result is simple, effective and is designed to work as an integral part of Gravity Flow. However, it's not intended to replace the advanced, full-featured Gravity PDF plugin which Gravity Flow also supports.
Adding a PDF Step
First, design the template. All Gravity Forms merge tags are supported.
By default, if you don't enable the email option below, a PDF will be generated on the server which can be downloaded with the following merge tags:
{workflow_pdf_download_link}
or
{workflow_pdf_download_url}
The {workflow_pdf_download_link} merge tag supports the following optional attributes:
text: (string) The text to use for the link. Default - "Download PDF"
signed: (true/false) Whether to add a signature to the URL. This will override all permission checks.
expires: (string) The length of time in English the URL should be valid - e.g. ("1 week"). Default - "20 minutes" (requires the signed attribute)
For example:
{workflow_pdf_download_link: text="Download your document" signed="true" expires="1 day"}
Note that the text attribute is not supported by the {workflow_pdf_download_url} merge tag which supports only the signed and expires attributes.
If the merge tag is signed then all permission checks are skipped. If you do not sign the merge tag, then before the PDF is delivered to the browser, the permissions for the current user are checked. If the current user has access to the workflow entry then the request will be fulfilled. Permissions for accessing the entry are determined by the following:
- gravityforms_view_entries capability
- gravityflow_status_view_all capability
- the current user is an assignee of the current step
It's also possible to construct a URL without the merge tags like this:
yourserver.com/?gravityflow-pdf-entry-id=999
(replace 999 with the ID of the entry)
Email the PDF as an Attachment
Enable the 'send by email' setting to send the PDF to the selected users. Selecting the role will send the email to all the users in the role. All Gravity Forms merge tags are supported.
When 'Send by email' is enabled then, the PDF would be sent with the default name and can also be downloaded from the server. If 'Custom File Name' is chosen, a custom name for the file sent via email can be specified. This custom name would be used for the file saved on the server.
Note: Any slashes ( / or \ ) included in the Custom File Names will be stripped out of the generated filename to avoid directory/folder related issues.
Tip: use the <pagebreak /> tag to add page breaks to your PDF.