Ponnusamy1-V / frappe-pdf

Render PDF from server using google-chrome
MIT License
9 stars 8 forks source link

Frappe PDF

frappe_pdf is an application built on the Frappe framework, designed specifically for rendering PDF files from HTML utilizing Google Chrome's headless mode. It addresses limitations present in wkhtmltopdf, providing better support for modern CSS features and overcoming various rendering constraints.

Note: Specify page size and margins in html to get a expected format.

example:

page {
    size: A4;
    margin: 5mm;
}

Features

Why Google Chrome Headless?

Google Chrome's headless mode is preferred due to its robust support for modern web standards, allowing for more accurate and reliable rendering of HTML to PDF compared to wkhtmltopdf. This choice ensures compatibility with the latest CSS features and addresses limitations encountered with wkhtmltopdf.

Limitations of wkhtmltopdf

Installation

Manual Installation

  1. Install bench.
  2. Once site is created, get the frappe-pdf app

    bench get-app https://github.com/Ponnusamy1-V/frappe-pdf.git
  3. After that, you can install the frappe_pdf app on the site
    bench --site sitename install-app frappe_pdf
  4. After installing app on your site, enable the option Generate PDF using Google Chrome in Print Settings.

Supported Frappe Versions

License

mit