Overview #

One of the most important features in a reporting tools or framework is the ability to export report to other formats such as PDF. The exported file can be pushed to download from browser, attached to email or simply stored for later used.

For longtime, exporting HTML To PDF is quite difficult due to several reason. First, PDF is still behind browser in term of CSS supporting which makes modern version of CSS does not work in PDF like it does in browser. The same happens to HTML. Second, modern chart and graphs uses Javascript to render. Google Charts suite is a big example. That hinders the ability to include those beautiful charts into PDF.

This Export package solved those problems and more.

Features #

  1. Exporting your HTML report to PDF and common image formats (JPG, PNG, BMP ..)
  2. Fine-pixel printing report with different sizes: A3, A4, A5, Letter, Legal, Tabloid
  3. PDF paging supported with customized repeated header and footer text in each page. The page number and total number of page are supported as well.
  4. In-page Javascript supported. This means you can include any kind of modern charts such as Morris, D3, Sparkline. You name it, we support it!
  5. Exported file can be save to local drive or can be pushed to browser for user to download.

What can I do with this package? #

  1. Well, you can export your report and store for later usage.
  2. You can export to PDF and attach it to email and send to key persons every week.
  3. You can let user download your report in PDF or their preferred image file.
  4. You can create invoice in familiar HTML, export it to PDF then send to your customer. That's professional!
  5. There will be much more! We will update this list.

Installation #

  1. Download the export package and unzip it.
  2. Copy the folder export into folder koolreport/packages
  3. Download PhantomJS execution file for operating system you are using:
  4. Unzip and put the execution file into the koolreport/packages/export/bin folder

Installation Node.js and Chromium #

In case you want to use chrome headless to export to PDF, please follow these steps:

  1. Download the export package and unzip it.
  2. Copy the folder export into folder koolreport/packages
  3. If you have admin right, download node.js from this link for your operating system https://nodejs.org/en/download/. Then install it on your server and go to folder koolreport/packages/export and run the following command line: npm i puppeteer
  4. If you can't install node.js on your server, please download the following portable node.js for your operating system:

All done! Enjoy exporting your report with KoolReport now.