documentation1Add my vote for this tag export1Add my vote for this tag pdf1Add my vote for this tag publish1Add my vote for this tag create new tag
, view all tags

To PDF Add-On

This addons converts TWiki topics into PDF`s. Comparing to GenPDF or others, its main goal yet is to support CSS as far as possible and therefore the PDF should just loook like the original topic

This Add On is based on GenPDF and finally, it should have the same great functionality as GenPDF. The reason its seperated is, because it will take some time to finish ToPDF to be that "user friendly" for every TWiki user, as GenPDF is. So ToPDF will exist as a alternative converter until the full functionallity of GenPDF is ported/combined.


  • the whole script is based on TWiki:Plugins/GenPDFAddOn
  • as backend it uses html2pdf, a php5 script to convert html files into PDFs. It supports CSS 2.0 and even float content.

Add-On Installation Instructions

Note: You do not need to install anything on the browser to use this add-on. The following instructions are for the administrator who installs the add-on on the server where TWiki is running.

Dependecies( Tested with linux, should work under windows too)


  • PHP5 as client modes, so for the use in the command line
  • Ghostscript-GPL ( worked with 8.61, please add other versions here, if you tested it )
  • pdflib ( worked with 7.0.2, please add other versions here, if you have tested it )
  • gnu-gs-fonts-std: Ghostscript Standard Fonts
  • gnu-gs-fonts-other: Ghostscript Extra Fonts


  • tba

Installation instructions

  • Download the ZIP file from the Add-on Home (see below)
  • Install all dependecies
  • Unzip ToPDFAddOn.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/ToPDFAddOn.txt Add-on topic
    data/TWiki/ToPDFAddOn.txt,v Add-on topic repository
    pub/TWiki/ToPDFAddOn/html2pdf html2pdf conversion Script including .htaccess which permits any browser-use
    bin/topdf Add-on script
  • Configuration
    • pub/ToPDFAddOn/html2pdf/configure.inc.php
      • BASEURL: Set your url, you use with TWiki. This is used for CSS files and stuff
      • TYPE1_FONTS_REPOSITORY: your absolute path to the ghostscript fonts ( e.g /usr/share/fonts/default/ghostscript/ )
      • DEFAULT_ENCODING: set this to your twik encoding
      • GS_PATH: your ghostscript path ( usually /usr/bin/gs )
    • pub/ToPDFAddOn/header.inc.php
      • Set your header and footer if needed

    • Add the PDF button to your viewtopicactions.skin.tmpl ( or somewhere else )
      • "%SCRIPTURLPATH%/topdf%SCRIPTSUFFIX%/%WEB%/%TOPIC%?pdftitle=%TOPIC%&t=%GMTIME{"$epoch"}%
  • Test if the installation was successful:
    • open view/TWiki/ToPDFAddOn and click this link and hopefully you get a PDF of the ToPDFAddOn topic.

Add-On Info

  • Set SHORTDESCRIPTION = Converts topics ( TML ) into PDF

Add-on Author: TWiki:Main.MayerEugen
Copyright: © 2006, TWiki:Main.MayerEugen
License: GPL (GNU General Public License)
Add-on Version: 01 Jun 2008 (V1.000)
Change History:  
01 Jun 2008: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1 (TWiki 4.0)
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
Add-on Home: http://TWiki.org/cgi-bin/view/Plugins/ToPDFAddOn
Feedback: http://TWiki.org/cgi-bin/view/Plugins/ToPDFAddOnDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/ToPDFAddOnAppraisal

Related Topic: TWikiAddOns

-- TWiki:Main/MayerEugen - 01 Jun 2008

Topic attachments
I Attachment History Action Size Date Who Comment
Compressed Zip archivetgz ToPDFAddOn.tgz r1 manage 1467.7 K 2008-07-10 - 12:02 MarkusUeberall ToPDFAddOn tar/gzip
Compressed Zip archivezip ToPDFAddOn.zip r1 manage 1803.9 K 2008-07-10 - 11:57 MarkusUeberall ToPDFAddOn zip
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2008-07-10 - MarkusUeberall
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.