Convert html to pdf files with smarty template engine. Download as file or display on browser.
$ composer require smarty/smarty
$ composer require leafo/lessphp
$ composer require knplabs/knp-snappy
Also you should download wkhtmltopdf
:
if you are in 32/64 bit Windows based system:
$ composer require wemersonjanuario/wkhtmltopdf-windows
if you are in 32 bit Linux based system:
$ composer require h4cc/wkhtmltopdf-i386 0.12.x
$ composer require h4cc/wkhtmltoimage-i386 0.12.x
or this if you are in 64 bit based system:
$ composer require h4cc/wkhtmltopdf-amd64 0.12.x
$ composer require h4cc/wkhtmltoimage-amd64 0.12.x
⚠️ If you are using CSS3 properties like Flex,BorderRadius etc: You should use -webkit prefixes
You can follow https://autoprefixer.github.io/
If you have enough experience about PHP, you not need this directive.
- Create your html files in
html
folder as .tlp(smart format) - Create your style files in
style
folder as .less format - first call smarty fetch
- then call pdfgenerator functions
Amiral Router!