Generating reports - PDF documents

Enabled is automatic creation of all documents necessary for the travel agency. All documents are in one place, they are easy to find and with only one click they can be sent to the selected e-mail, convert to pdf or print out.

Automatized making of contracts, invoices, proforma invoices, reservations and pre-reservations.

Creation of vouchers, prepayment invoice, invoice, preinvoice.

EasyTravelManager documents page.
EasyTravelManager PDF document.

 

All documents at first are generated as HTML pages. After that I used WKHTML2PDF tool for creating PDF documents.



WKHTMLtoPDF

  • What is WKHTML2PDF and how to use it: http://wkhtmltopdf.org/
  • WKHTML2PDF on Linux ( desktop vs server)
    • WKHTML2PDF needs GUI for generating PDFs. Instead of GUI on Linux server we can use X server
      • on debian like linux X server installation and configuration is usually easy and include 2 steps: installation of xvfb apt-get install xvfb and configuration echo 'xvfb-run --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf $*' > /usr/bin/wkhtmltopdf.sh if wkhtml2pdf is previously installed.
  • PHP and WKHTML2PDF
    • We can run WKHTML2PDF from console ( wkhtmltopdf http://google.com google.pdf )
      • In this case we need php shell_exec (http://php.net/manual/en/function.shell-exec.php)
    • Or we can compile wkhtml2pdf C library with PHP
      • Download libwkhtmltox from http://download.gna.org/wkhtmltopdf/0.12/0.12.1/ for specific OS
      • Copy lib/libwkhtmltox.so from libwkhtmltox to /usr/local/lib
      • Copy include/wkhtmltox from wkhtmltopdf to /usr/local/include
      • ldconfig -v | grep wkhtml (check if its loaded)
      • download php-wkhtmltox from github ( https://github.com/mreiferson/php-wkhtmltox )
      • Install devtools apt-get install build-essential php5-dev (ubuntu example)
      • phpize ; ./configure ; make install ;
      • Add extension extension=phpwkhtmltox.so in php.ini