Any PDF Plugin

Generate high quality PDF files from topics.

Introduction

This Plugin lets you use any Pdf-Creator and is not bound down to a specific one. Just configure the one you want to use in your Foswikis config. The Creator will be called like "$executable $opt1 $infile $outfile $opt2". You just need to make sure your creator can be used in this way

Example Configurations

Pdf-Creator Before After Comment
phantomjs /path/to/rasterize.js format If it is not working with Ubuntu update phantomjs, as the version in the repo is too old.
wkhtmltopdf -q --enable-plugins --outline --print-media-type   no after command needed

Usage

View the PDF version of a topic by adding contenttype=application/pdf to the url like this:
%SCRIPTURL{"view"}/%WEB%/%TOPIC%?contenttype=application/pdf

Test this: http://365847.689093.cn/Extensions/AnyPdfPlugin?contenttype=application/pdf

Limitations

  • Currently you can only create one page at a time.

Adding PDF buttons to the page

Add pdf to the skin path, for example:
   * Set SKIN = pdf,pattern

or to put the 'pdf skin' in front of any skin:
   * Set COVER = pdf

The button label is configurable. Re-define module pdf:text in your own skin, and put it in front of the skin path:
   * Set SKIN = myskin,pdf,pattern

For more help see SkinTemplates.

Installation instructions

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.

Configuration settings

In Configure you can set these settings:

Setting Explanation Default value
pdfcmd Location of the the pdf-creator executable. /usr/bin/phantomjs
pdfparams Parameters passed to the pdf-creator. /usr/share/phantomjs/examples/rasterize.js
pdfformat Parameters passed to the pdf-creator ater the file names A4
Debug Writes debugging output to debug.log. 0

Plugin Info

Author: Foswiki:Main/LukasResch
Copyright ©: Lukas Resch
License: GPL
Release: 1.0.0
Change History:  
31 Jan 2014 1.0.0 First release.
Dependencies:
NameVersionDescription
Any Pdf-Creator Required
File::Temp >0 Required
Home: http://foswiki.org/Extensions/AnyPdfPlugin
Support: http://foswiki.org/Support/AnyPdfPlugin
-- LukasResch - 03 Feb 2014
I Attachment Action Size Date Who Comment
AnyPdfPlugin.md5md5 AnyPdfPlugin.md5 manage 159 bytes 03 Feb 2014 - 22:42 LukasResch  
AnyPdfPlugin.sha1sha1 AnyPdfPlugin.sha1 manage 183 bytes 03 Feb 2014 - 22:42 LukasResch  
AnyPdfPlugin.tgztgz AnyPdfPlugin.tgz manage 11 K 03 Feb 2014 - 22:42 LukasResch  
AnyPdfPlugin.zipzip AnyPdfPlugin.zip manage 16 K 03 Feb 2014 - 22:42 LukasResch  
AnyPdfPlugin_installerEXT AnyPdfPlugin_installer manage 4 K 03 Feb 2014 - 18:12 LukasResch  
Topic revision: r2 - 03 Feb 2014, LukasResch
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy