PDF or Image generation from a URL or HTML page easily. It uses the excellent webkit-based wkhtmltopdf and wkhtmltoimage available on OSX, Linux & windows.
Enupal Snapshot allows set a global asset and sub-path (twig code allowed) to store your files. Override the asset and sub-path before generating your files in your templates, more info here.
{% set settings = {
filename: 'my-first.pdf'
}
%}
{{ craft.enupalsnapshot.displayHtml("<h1>Hello world!</h1>", settings) }}
{% set settings = {
filename: 'my-first.pdf',
variables: {
foo: 'barr'
}
}
%}
{{ craft.enupalsnapshot.displayTemplate("pdf/examples/summary", settings) }}
{% set settings = {
filename: 'my-first.pdf',
inline: false,
}
%}
{% set url = craft.enupalsnapshot.displayHtml("<h1>Hello world!</h1>", settings) %}
<a target="_blank" href="{{url}}"> Download Pdf</a>
{% set settings = {
filename: 'my-first-image.png',
asImage: true
}
%}
{% set url = craft.enupalsnapshot.displayHtml("<h1>Hello world!</h1>", settings) %}
<a target="_blank" href="{{url}}"> Download Image</a>
{% set urls = {0: 'https://www.google.com', 1:'http://enupal.com'} %}
{% set settings = {
filename: 'my-first.pdf'
}
%}
{{ craft.enupalsnapshot.displayUrl(urls, settings) }}
All available options here:
{% set settings = {
filename: 'my-first.pdf',
cliOptions: {
'cover': '<h1>Hello world from Enupal Snapshot</h1>',
'header-font-size': '36',
'footer-right': null,
'orientation': 'Portrait',
'page-size': 'A4'
}
}
%}
{{ craft.enupalsnapshot.displayHtml("<h1>Hello world!</h1>", settings) }}
https://docs.enupal.com/enupal-snapshot/
-
Send us a note at: support@enupal.com
-
Create an issue on Github
Brought to you by enupal