TIP GenPDFWeasyPlugin is not installed on Foswiki.org.


Generate PDF using WeasyPrint

This plugin generates PDF using the third-party tool WeasyPrint. You will have to download this tool and install it on the Foswiki Server before being able to use it for Foswiki.


Get a PDF by adding contenttype=application/pdf to the view url like this:

Optionally an url parameter outfile can be used to specifiy the target filename of the pdf being generated. If not specified explicitly it defaults to genpdf_%!TOPIC%.pdf


Installation Instructions

Installation instructions for weasyprint can be found on their site.

For a Debian/Ubuntu based installation use this:

apt-get install python-dev python-pip python-lxml \
                libcairo2 libpango1.0-0 libgdk-pixbuf2.0-0 \
                libffi-dev shared-mime-info
pip install WeasyPrint

Test with

weasyprint --help

Make sure that you record the full path to the binary and configure this plugin accordingly.

which weasyprint

Most probably, when installing weasyprint manually, this will be /usr/local/bin/weasyprint as is the default in this plugin's configuration.

If you are using other plugins that implement a completePageHandler (see InstalledPlugins) then you most probably need to tune the $Foswiki::cfg{PluginsOrder} to list the GenPDFWeasyPlugin behind those, for example like this:

$Foswiki::cfg{PluginsOrder} = 'SpreadSheetPlugin,PageOptimizerPlugin,NatSkinPlugin,GenPDFWeasyPlugin,SlideShowPlugin';

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.



Change History

16 Sep 2015 initial release
Topic revision: r1 - 16 Sep 2015, MichaelDaum - This page was cached on 30 May 2016 - 22:22.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License