Add-on, ExpressionEngine, PDF
PDF Press Next
Generate accurate looking PDFs from your template code
Buy NowWHY PDF PRESS NEXT
Better Looking PDFs
Revolutionize the way you present your content with PDF Press Next! Say goodbye to bland and uninspiring PDFs. Our cutting-edge add-on harnesses the power of headless Chrome to create PDFs that are not only functional but stunningly beautiful. Whether you're sharing reports, portfolios, or presentations, PDF Press Next ensures that your documents leave a lasting impression. Elevate your professional image and captivate your audience with PDFs that are as visually striking as they are informative.
More Modern Technology
Embrace the future of document generation with PDF Press Next! We're leaving outdated methods behind and embracing the latest in technology to streamline your PDF creation process. By leveraging headless Chrome, PDF Press Next offers unparalleled efficiency and reliability, ensuring that your PDFs are generated swiftly and accurately every time. Join the ranks of forward-thinking professionals who are embracing modern solutions to enhance their workflow. With PDF Press Next, you're not just keeping up with the times – you're staying ahead of them.
Works with JavaScript
Unlock limitless possibilities for your PDFs with PDF Press Next! Unlike traditional PDF generators, PDF Press Next fully supports JavaScript, empowering you to create dynamic and interactive documents like never before. Whether you're embedding charts, forms, or multimedia elements, PDF Press Next ensures that your JavaScript-powered content shines through seamlessly in your PDFs. Don't let limitations hold back your creativity – with PDF Press Next, the only boundary is your imagination. Experience the freedom to craft engaging and interactive PDFs that truly stand out from the crowd.
PREREQUISITES
- PHP 8.0+
- ExpressionEngine 6.0+
- Node v16+ (recommended LTS)
- Opcache
- IMagick or GMagick (recommended)
INSTALLATION
- Copy entire
pdf_press_next
folder to yoursystem/user/addons
folder. - On your EE backend, navigate to
Developer > Addons
(yoursite.com/admin.php?/cp/addons). - Scroll to
Third Party Add-Ons
. - Find
PDF Press NEXT
and clickInstall
. - Add your settings, and enjoy!
CONFIGURATION
- Ensure that you have Node working on the server.
- Ensure your site_url is defined in your config. We need this to access the add-on URL while building PDFs.
- Add in your Node path to your EE config. You can find this on Linux based systems by running `which node`
EXAMPLE:
$config['pdf_press_next_node_path'] = '/weird/path/to/node/node';
USAGE
PDF Press NEXT has one tag, which generates a link to your PDF.
save_to_pdf: Generate PDF
The save_to_pdf
tag generates a link to download the template as a PDF, it must contain the following parameters:
- url: Should be the ENTIRE URL that you want rendered to the PDF.
- filename: Sets the filename for the downloaded PDF. Default: filename.pdf
{exp:pdf_press_next:save_to_pdf url="{site_url}/path/to/my/pdf" filename="download.pdf"}
Additional Parameters
cookies
JSON, Cookie objects to set.
display-header-footer
<[boolean]> Display header and footer. Defaults to false.
{exp:pdf_press_next:save_to_pdf url="{site_url}/path/to/my/pdf" filename="download.pdf" display-header-footer="y"}
footer-template
<[string]> HTML template for the print footer. Should be valid HTML markup with following classes used to inject printing values into them.
- date: formatted print date
- title: document title
- url: document location
- pageNumber: current page number
- totalPages: total pages in the document
footer-template-url
<[string]> URL for desired HTML template. See footer-template
for additional options.
format
Paper format. If set, takes priority over width or height options. Defaults to 'Letter'.
header-template
<[string]> HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them.
- date: formatted print date
- title: document title
- url: document location
- pageNumber: current page number
- totalPages: total pages in the document
header-template-url
<[string]> URL for desired HTML template. See header-template
for additional options.
height
<[string]> Paper height, accepts values labeled with units.
landscape
<[boolean]> Paper orientation. Defaults to false (portrait).
{exp:pdf_press_next:save_to_pdf url="{site_url}/path/to/my/pdf" filename="download.pdf" landscape="y"}
margin
JSON, Paper margins, defaults to none.
{exp:pdf_press_next:save_to_pdf url="{site_url}/path/to/my/pdf" filename="download.pdf" margin="{'top': '2rem', 'bottom': '1rem', 'left': '2px', 'right': '1cm'}"}
media-type
<[string]> Changes the CSS media type of the page. The only allowed values are 'screen', 'print' and null. Passing null disables media emulation.
{exp:pdf_press_next:save_to_pdf url="{site_url}/path/to/my/pdf" filename="download.pdf" media-type="screen"}
omit-background
<[boolean]> Hides default white background and allows capturing screenshots with transparency. Defaults to false.
{exp:pdf_press_next:save_to_pdf url="{site_url}/path/to/my/pdf" filename="download.pdf" omit-background="y"}
page-ranges
Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
{exp:pdf_press_next:save_to_pdf url="{site_url}/path/to/my/pdf" filename="download.pdf" page-ranges="1,3-4"}
page-wait-for
<[integer]> Timeout in milliseconds to wait for.
{exp:pdf_press_next:save_to_pdf url="{site_url}/path/to/my/pdf" filename="download.pdf" page-wait-for="5000"}
prefer-css-page-size
<[boolean]> Give any CSS @page size declared in the page priority over what is declared in width and height or format options. Defaults to false, which will scale the content to fit the paper size.
{exp:pdf_press_next:save_to_pdf url="{site_url}/path/to/my/pdf" filename="download.pdf" prefer-css-page-size="y"}
print-background
<[boolean]> Print background graphics. Defaults to false.
{exp:pdf_press_next:save_to_pdf url="{site_url}/path/to/my/pdf" filename="download.pdf" print-background="y"}
scale
<[number]> Scale of the webpage rendering. Defaults to 1
{exp:pdf_press_next:save_to_pdf url="{site_url}/path/to/my/pdf" filename="download.pdf" scale="2"}
timeout
<[number]> Maximum time in milliseconds, defaults to 30 seconds, pass 0 to disable timeout.
{exp:pdf_press_next:save_to_pdf url="{site_url}/path/to/my/pdf" filename="download.pdf" timeout="2"}
viewport
JSON, sets viewport for document reading. Items should include:
- width: <[number]> page width in pixels.
- height: <[number]> page height in pixels.
- deviceScaleFactor: <[number]> Specify device scale factor (can be thought of as dpr). Defaults to 1.
- isMobile: <[boolean]> Whether the meta viewport tag is taken into account. Defaults to false.
- hasTouch: <[boolean]> Specifies if viewport supports touch events. Defaults to false
- isLandscape: <[boolean]> Specifies if viewport is in landscape mode. Defaults to false.
width
<[string]> Paper width, accepts values labeled with units.
EXAMPLE
{exp:pdf_press_next:save_to_pdf url="{site_url}/path/to/my/pdf" filename="projects.pdf" scale="1" landscape="y" print-background="y"}
This will create a link to open a PDF titled "projects.pdf" in the browser using the web path to /path/to/my/pdf. This will render all EE code with CSS and JS in place, print in landscape, and print the background.
TROUBLESHOOTING
Puppeeter will throw various issues based on what you have sent through. This may be a non-matching type of data (i.e. number vs string), or missing data (i.e. empty scale parameter). Please read these errors carefully.
Please visit The Puppeeteer docs for some related issues. Please refer to support below for assistance.
SUPPORT
For any issues, please reach out to mailto:[email protected].
Support is limited to licensed PDF Press Next users, and is focused on technical issues with the add-on. Though we're happy to help with styling issues to some extent, this is only available via paid support.