PDF from Template

Last updated: March 7th 2020

You can pass your twig template along with all the possible variables you want to use into pdf content.

Basic Example
{% set settings = {
    filename: "My_PDF",
} %}

{% set vars = {
	entry : entry,
	data : data
} %}

{{ craft.superpdf.template("template/_pdf_template", settings, vars) }} }}
Basic Example to get PDF URL
{% set settings = {
    filename: "My_PDF",
    type: 'url'
} %}

{% set vars = {
	entry : entry,
	data : data
} %}

{% set url = craft.superpdf.template("_pdf_code", settings, vars) %}

PDF URL is: {{ url }} }}