PDF Reports

Reportico can produce reports in PDF output. Reportico provides two engines for generating PDF reports :- TCPDF and FPDF. TCPDF is the default and provides more options for styling the report to provide colors, borders, margins, paddings generally through CSS like notation.

FPDF is quicker to run but offers a limited subset of control over syling.

To set the PDF engine to use the run.php script should be modified as follows:-

  $q->reportico_engine = "fpdf";
  $q->reportico_engine = "tcpdf";

PDF Font and Language Support

For TCPDF, fonts are stored under the folder tcpdf/fonts. To add your own fonts, the site http://www.xml-convert.com/en/convert-tff-font-to-afm-pfa-fpdf-tcpdf can be used to upload yor TTF to convert into the relevant to store under this folder.

For FPDF, Reportico makes use of both PDF generation libraries FPDF (www.fpdf.org) and the add-on UFPDF (http://acko.net/blog/ufpdf-unicode-utf-8-extension-for-fpdf/). Depending on the chosen PDF reporting font, one or the other will be used. FPDF is used to produce reports in an ASCII character set (an operates more quickly ) and UFPDF is a Unicode variant that is able to produce non-ASCII characters assuming a suitable font is provided. Users wishing to output their data in a non-English only character sets, which include characters not found in standard ASCII, should choose a Font which caters for their language. Users wanting non-standard fonts can import their own. Note that if the font supports many characters it can have quite an impact on the report generation time.

Note that if a UTF-8 font is used then the project output character set must be set to UTF-8 too. Reportico cannot calculate whether a PDF is UTF-8 or not.

Reportico comes with a small set of supported fonts. For ASCII reporting (e.g. Latin character sets), Reportico comes with helvetica, times, courier and times fonts. Reportico comes with several Truetype Unicode fonts :- LiberationSans-Regular (good for most European character sets), Mothanna/Thabit for arabic support, WenQuanYiZenHei for Chinese support, japanese-gothic for Japanese support. Others will be added over time.

Using your own custom fonts

To load your own custom font from a Truetype font, go to the fpdf/font area and see the README.txt file in there for instructions. On a linux machine you should be able to got to the fpdf/font directory, copy a ttf font file in there and run sh makepdffont fontname-without-ttf-extension. This should create a fontname.php file. To use the font as a project default you can edit the config.php file in your project directory and change the parameter SW_DEFAULT_pdfFont to the name of your font (without the ttf extension). To set the font in a single report file edit the report in design mode, go to the Format and enter the font name against the Font (PDF) field.

  • pdf_reports.txt
  • Last modified: 2018/05/04 21:40
  • (external edit)