User authentication is temporarily unavailable. If this situation persists, please inform your Wiki Admin.

Migration Note

Upto and including the SI_20071231 release, the location of the pdf library is at include/pdf/ . Thereafter in the SVN, the location has been migrated to library/pdf/ . The newer location is referenced here. The instructions here are irrespective of the location.

Single Domain Version

An older version of Tufat's html2pdf is used here.

In library/pdf/ - writeable folders set to /cache folder relatively

define('CACHE_DIR', HTML2PS_DIR.'/../../cache/');
define('OUTPUT_FILE_DIRECTORY', HTML2PS_DIR.'/../../cache');
define('WRITER_TEMPDIR', HTML2PS_DIR.'/../../cache/');

Multi Domain Version

An newer version of Tufat's html2pdf (v2.0.35) is used here. The leading slash (/) is pre-concatenated into HTML2PS_DIR define at the beginning of the code itself and there is a toggle in the trailing slash requirement for the last two defines.

In library/pdf/ - writeable folders set to /cache folder relatively

define('CACHE_DIR', HTML2PS_DIR.'../../cache/');
define('OUTPUT_FILE_DIRECTORY', HTML2PS_DIR.'../../cache/');
define('WRITER_TEMPDIR', HTML2PS_DIR.'../../cache');

Both Versions

The following files from the library/pdf/demo folder are to be copied to the /library/pdf/ folder : generic.param.php and html2ps.php

The fonts in the /library/pdf.fpdf/font folder are not part of the original library and must be copied across versions verbatim while upgrading the library.

In library/pdf/html2ps.php

Replace Line 10:




Replace Line 67:




Replace Line 195:

   $pipeline->destination = new DestinationDownload($filename);


   $pipeline->destination = new DestinationDownload($_GET['pdfname']);

Replace Line 198:

   $pipeline->destination = new DestinationFile($filename, 'File saved as: <a href="%link%">%name%</a>');


   $pipeline->destination = new DestinationFile($_GET['pdfname'], '%name%');

At the beginning of the library/pdf/html2ps.php file, just after the php opening tag, it is advisable to insert the following code that is currently in the Single Domain Version

if ($authenticationOn == 'true' ) {

To reduce the size of the PDF file generated, in the newer version of the library, the list of fonts that are included in the PDF file can be set in the library/pdf/html2ps.config file - we can turn off (0) font inclusion for all Arial family fonts as all major desktop operating systems like Windows, Linux and Macintosh have them installed by default. For further info, refer How to reduce generated PDF size.

 | wiki/html2pdf_mods.txt · Last modified: 2016/10/11 06:15 (external edit)