|
Cookbook /
GeneratePDFSummary: Generate PDF versions of pages (?action=pdf)
Version: 2006-09-07
Prerequisites: PmWiki >=2.1.0, htmldoc >=1.8.27
Status: Stable
Maintainer: Pm
Categories: PDF
Questions answered by this recipe
DescriptionThe htmldoc package combined with the generatepdf.phpΔ script adds an ?action=pdf option that will generate PDF copies of a wiki page. NotesFirst, download and install htmldoc onto your system, and download and install the generatepdf.phpΔ script into your cookbook directory. Next, tell the GeneratePDF script where to find the htmldoc command on your system: $HtmlToPdfCmd = '/path/to/htmldoc -t pdf --quiet --webpage';
include_once('cookbook/generatepdf.php');
That's it! Using ?action=pdf on your pages should result in PDF versions of the file. For example, you can try it on this page with Cookbook.GeneratePDF?action=pdf. By default, GeneratePDF uses PmWiki's 'print' skin to format the page; this can be changed by setting Comments
You could add this after line 46 in generatepdf.php :
header("Content-Disposition: attachment; filename=$pagename.pdf");
Nicolas Poulain 26 April 2008 I have downloaded the software (htmldoc) in 2 different versions (both complete and exe files). Unfortunately, neither one is recognized (the install wasn't because I had to purchase a license and the complete package didn't respond to any queries). Is there something in the works that will convert our PMWiki files into pdf? -Chris (August 25, 2008) Test with an imageSee Also
Contributors |