This is an old revision of the document!
Table of Contents
Export DokuWiki Pages to PDFs
Several methods exist to convert your wiki pages to PDFs. See also the full list of plugins tagged 'PDF'.
Plugins that export directly to PDF:
- <code php> <div class="bar" id="bar_top"> <div class="bar-left" id="bar_topleft"> < then it wont complain about these missing files, as the system will not try to start a “pdf” plugin
html2ps PHP Script
Using the html2ps PHP script requires only little changes and additions to the DokuWiki source code.
- Install html2ps. (To run the php script you'll need ghostscript or libpdf - install them first!)
- Add the Export to PDF button as described above.
- In the function
act_export
, ininc/actions.php
, add this:if ($act == 'export_pdf') { header("Location: " . DOKU_BASE.'html2ps/html2ps.php?URL='.urlencode(wl($ID, '', true)).'&pixels=1024&media=A4&ps2pdf=2&output=0&cssmedia=screen&renderimages=1&scalepoints=1&leftmargin=10&rightmargin=10&topmargin=10&bottommargin=10'); exit; }
Variations
If you want to remove the wiki structures and send the raw html page to the pdf exporter, edit the above so that
urlencode(wl($ID, '', true))
⇒
urlencode(wl($ID, '', true).'&do=export_html')
You may also wish to vary other options for the html2ps command, these can be found in the documentation on the html2ps site. I add renderlinks=1 and method=fastps (for building using ghostscript) to mine.
html2ps discussion
If your Wiki uses HTTPS, then get the patch for html2ps.
Issues
This appears to only work with pages that allow anonymous read access.
*Is-someone knows where I can found the html2ps.php file ?. It's not provided with the package. Thanks. The file is in the Demo directory. Use the index file and the single URL convert to test your website before. My Website is Strict XHTML but looks horrible in PDF. Best regards from Germany.