Settings for PDF action

Syntax

Settings for wkhtmltopdf processed by PDF.py action. See wkhtmltopdf documentation for additional information. Note: only a subset of settings are processed by the action.

margin-top <unitreal>       Top margin (default 10mm)
margin-bottom <unitreal>    Bottom margin (default 10mm)
margin-left <unitreal>      Left margin (default 10mm)
margin-right <unitreal>     Right margin (default 10mm)
page-height <unitreal>      Page height
page-size <Size>            Page size: A4, Letter, etc. (default A4)
page-width <unitreal>       Page width
title <text>                Title of PDF, [title] replaced with page name
header-font-name <name>     Header font (default Arial)
header-font-size <int>      Header font size (default 12)
header-spacing <int>        Header space from margin (default 0)
header-line                 Add line below header 
header-left <text>          Header text
header-center <text>        Header text         
header-right <text>         Header text
footer-font-name <text>     Footer font (default Arial)
footer-font-size <name>     Footer font size (default 12)
footer-spacing <int>        Footer space from margin (default 0)
footer-line                 Add line above Footer 
footer-left <text>          Footer text
footer-center <text>        Footer text
footer-right <text>         Footer text

Text substitution codes used by wkhtmltopdf, with some modified or added for PDF.py action. See wkhtmltopdf documentation for additional information.

[page]        Number of the pages currently being printed
[frompage]    Number of the first page to be printed
[topage]      Number of the last page to be printed
[webpage]     URL of the page being printed
[url]         Cleaned URL, %20 to space *wiki
[section]     Name of the current section
[subsection]  Name of the current subsection
[date]        User date in system format *wiki
[time]        User time in system format *wiki
[title]       Title of current page
[pagename]    Wiki page name *wiki
[doctitle]    Title of output document

*wiki = modified or added for local implementation.

 

Defaults

Defaults used by PDF.py action, which can be changed at installation, or on a page by page bases basis using #pragma pdf processing instruction as given in the example below.

Only settings that differ from wkhtmltopdf defaults are sent during the subprocess call.

## Defaults for this wiki
margin-top 20mm
margin-bottom 20mm
## margin-left 10mm
## margin-right 10mm
## page-height 297mm
## page-size A4
## page-width 210mm
title [pagename]
## header-font-name Arial
header-font-size 9
header-spacing 10
header-left [pagename]
## header-center         
header-right [date] [time]
## footer-font-name Arial
footer-font-size 9
footer-spacing 10
footer-left [url] 
## footer-center
footer-right [page] of [topage]

## = wiki default the same as wkhtmlpdf default, so not sent.

Example pragma settings

The defaults used by the plugin can be overridden for individual pages using the wkhtmltopdf settings and text substitution codes listed above in #pragma pdf processing instructions.

## Example for this page, overriding defaults for these settings only.
#pragma pdf header-left
#pragma pdf header-centre [section]
#pragma pdf header-right
#pragma pdf footer-centre [page] of [topage]
#pragma pdf footer-right [date] [time]

PDF.py/Settings (last edited 2013-02-13 09:24:28 by IanRiley)