Git Product home page Git Product logo

printmpdf's Introduction

Print using mPDF (printmpdf)

This branch is working with mPDF 8.2.x. and php 8.2

Converts a HTML page to PDF using mPDF PHP Library. It allows you to generate the following pdf documents of any node:

www.example.com/node/nid/pdf

where nid is the node id of content to render.

INSTALLATION

Enable the Print Using mPDF module: Administration > Modules (admin/modules)

CONFIGURATION

  • There are several settings that can be configured in the following places:

    Administration > Modules (admin/modules) Enable or disable the module. (default: disabled)

    Configuration > User accounts > Permissions (admin/config/people/permissions) Under Print using mPDF module.

    Configuration > User interface > Print using mPDF settings (admin/config/user-interface/mpdf) This is where all the module-specific configuration options can be set.

ICON and css

  • A pdf Icon (used for the button) and a ccs file are included with this module: . file-icon.pdf-50px.png . css/prinmpdf.css with the (example) class hideinpdf to hide elements in the PDF outptut

PRINTMPDF custom extra field with a pdf button

  • This field is added to the types activated (default: all) through the "Print using mPDF settings"

  • Using the node display you can control the visibility, label and weight of the pdf button. Don't forget to flush the cache after making changes!

  • It should be hidden in the 'Default' display setting so the Icon does not appear in the generated pdf output.

. The button is wrapped with <div class="printmpdfbutton">

API

printmpdf_api()

This api function is available to content developers that prefer to generate a pdf file of custom path. The function takes two parameters, first a rendered html content and an optional second parameter, name of the pdf file.

Calling the function like this:

printmpdf_api($html)

will return the PDF file for the current html passed to it.

It is also possible to specify the function like this:

printmpdf_api("<html><body>Hello</body></html>", "mypdf")

will return the PDF file with a "Hello" and file named "mypdf.pdf".

MPDF TOOL

The printmpdf module requires the use of an external PDF generation tool. The currently supported tools are mPDF. Please note that any errors/bugs in those tools need to be reported and fixed by their maintainers. DO NOT report bugs in those tools in the PDF Using mPDF module's issue queue at backdropcms.org

Default location /modules/printmpdf/mpdf/

MPDF support:

The mpdf Library Vesrion 6.1 is distributed with the printmpdf. MPDF's support for CSS is considerably worse than the other tools. Unicode is supported (use of Unicode fonts result in HUGE files). Page header and footer are supported.

MPDF LIMITATIONS and ISSUES

See https://mpdf.github.io/about-mpdf/limitations.html and https://github.com/mpdf/mpdf/issues

Current Maintainer

Credits

  • Originally written for Drupal by AbhijeetKalsi, gauravjeet_singh, sudanshu.singh, Bhupendra Singh, Yash Sharma (http://www.osscube.com/)

License

This project is GPL v2 software. See the LICENSE.txt file in this directory for complete text.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.