Skip to content

fashxp/web2print-tools

 
 

Repository files navigation

Web2Print Plugin for Pimcore

Adds following additional features to the web2print functionality of pimcore.

  • Favorite Output Channels
  • Document Editable for Configurable Tables
  • Custom Document Areas
  • PDFreactor controller plugin
  • samples for document areas, css styles, etc.
  • table of contents creation (awesomizr.js)

Favorite Output Channels

Based on the OutputDataConfigToolkit (https://github.com/pimcore-partner/Elements_OutputDataConfigToolkit) this feature allows to save output channels centrally and reuse them in several places.

favorite-output-channels

Document Editable for Configurable Tables

Editable for adding tables with configurable columns based on the output channels to documents.

outputputcanneltable

Usage:

<?php
echo $this->outputchanneltable("tableconfig");

Also see included sample areas PrintColumnAttributeTable and PrintRowAttributeTable.

PDFreactor PDF Creation Helper

PDFreactor PDF Creation Helper allows you to integrate web2print functionality directly into the controller and creates a pdf response from a given HTML.

Usage in controller action:

<?php

    public function myAction() {

        //do some stuff...

        $reactor = new ReactorPDF();
        return $reactor->createPDFResponse($renderedHTML);

    }

With url parameter html=1 pdf rendering is deactivated.

Create table of contents

/**
 * - include bundles/web2printtools/vendor/js/awesomizr.js
 * - include bundles/web2printtools/vendor/css/awesomizr.css
 */

Awesomizr.createTableOfContents({
    insertiontarget: '#toc-wrapper',
    elements: ['h1','h2'],
    container: {tag: 'ul', addClass: 'toc'},
    line: {tag: 'li'},
    disabledocumenttitle: true,
    toctitle: ' ',
    text: function (elem) {
        return elem.textContent;
    }
});

See example: toc.js See full documentation and examples: pdfreactor-manual

Migration from Pimcore 4

  • change table name from plugin_web2print_favorite_outputdefinitions to bundle_web2print_favorite_outputdefinitions
  • changed namespace from Web2Print to Web2PrintToolsBundle
  • renamed permission from plugin_web2print_favourite_output_channels' to web2print_web2print_favourite_output_channels`
  • removed Custom Document Areas
  • PDFReactor controller plugin replaced by PDFreactor PDF Creation Helper

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 51.3%
  • PHP 46.6%
  • CSS 2.1%