enupal/snapshot

There is no license information available for the latest version (3.0.0) of this package.

PDF or Image generation from a Url or HTML page

Installs: 34 225

Dependents: 0

Suggesters: 0

Security: 0

Stars: 10

Watchers: 7

Forks: 3

Open Issues: 14

Type:craft-plugin

3.0.0 2024-04-01 09:19 UTC

README

68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656e7570616c2f736e617073686f742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572 68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656e7570616c2f736e617073686f742f6261646765732f636f7665726167652e706e673f623d6d6173746572 68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656e7570616c2f736e617073686f742f6261646765732f6275696c642e706e673f623d6d6173746572 68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656e7570616c2f736e617073686f742f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572

Enupal Snapshot

Enupal Snapshot Plugin for Craft CMS

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.

Features

Store your PDF or Image files in Assets

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.

Display the Pdf in browser from Html

{%  set settings = {
        filename: 'my-first.pdf'
    }
%}

{{ craft.enupalsnapshot.displayHtml("<h1>Hello world!</h1>", settings) }}

Display the Pdf in browser from template

{%  set settings = {
        filename: 'my-first.pdf',
        variables: {
            foo: 'barr'
        }
    }
%}

{{ craft.enupalsnapshot.displayTemplate("pdf/examples/summary", settings) }}

Download url of the Pdf from Html

{%  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>

Download url as an Image

{%  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>

Display the Pdf in browser from Urls

{% set urls = {0: 'https://www.google.com', 1:'http://enupal.com'} %}

{%  set settings = {
        filename: 'my-first.pdf'
    }
%}

{{ craft.enupalsnapshot.displayUrl(urls, settings) }}

Add cliOptions

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) }}

Documentation

https://docs.enupal.com/enupal-snapshot/

Enupal Snapshot Support

Brought to you by enupal

Enupal Snapshot