Install Template via Template Manager
After you've created your custom template, you can zip up the files and install them via the PDF Template Manager.
Zip Archive Structure
To create a .zip
package, just zip up your PDF template file(s) in the root of the zip archive:
+-- PACKAGE.zip
| +-- hello-world.php
Multiple templates can be installed via a single zip archive:
+-- PACKAGE.zip
| +-- hello-world.php
| +-- hello-moon.php
If you've created a configuration and/or image file for your template, include them in their correct directories (config
/images
):
+-- PACKAGE.zip
| +-- hello-world.php
| +-- /config/
| +-- hello-world.php
| +-- /images/
| +-- hello-world.png
Common Problems
No valid PDF template found in Zip archive / The PHP file [Name] is not a valid PDF Template.
These errors can occur if:
The PHP template is NOT in the root of your zip archive. Open the archive and make sure there's not a directory in the root which then contains your template file(s). If they are, re-create the zip archive.
The PHP template does not contain a valid header structure. Edit your template and ensure you add all the required headers, then zip up and try again.
I uploaded my template to the PDF Working Directory using (S)FTP but it isn't showing up/the old header information is still showing when I configure my PDF
Gravity PDF caches the installed custom templates and the associated header data. The cache is automatically flushed when (re)installing a templates via the PDF Template Manager. But if you upload the template via (S)FTP or a File Manager, you should toggle on Debug Mode to clear it.