Features
- FontAwesome Icons
- Adding Fonts
- Formatters
- Headers and Footers
- HTML Debugging
- LATTE Template Engine
- Page Dimensions
- Preview Features
- Using Stylesheets
- Using Templates
Requirements
PHP>=8.1ProcessWire>=3.0.205RockFrontend>=3.8.2Less- FontAwesome Icons
LATTE Template Engine
All examples use regular HTML or PHP syntax. I prefer to use LATTE for all my documents as it helps me to keep my templates clean and it provides many great helpers that would otherwise need additional checks.
As RockPdf relies on RockFrontend we have LATTE support out of the box 😎🚀
You don't know latte yet? Be sure to check out their website at https://latte.nette.org/de/ and also check this forum post: Why I love the Latte Template Engine.
All you have to do is load a LATTE file instead of an HTML or PHP file:
/** @var RockPdf $pdf */
$pdf = $modules->get('RockPdf');
$pdf
->load("/site/test.latte")
->save(preview: true);
Latte and mPDF tags
mPDF tags like {PAGENO}
conflict with the default latte single brace syntax. Simply change the syntax to off
or double
:
<p n:syntax="off">Page {PAGENO}/{nb}</p>