Exporting Wiki content to PDF


I'm opening this page for a prelilminary discussion on how to generate PDFs from Wiki content.

An appropriate implementation of this feature would probably be a /pdf handler allowing a user to generate a PDF from a given page.
(More generally, an /export handler could give the user the choice about the preferred export format). There are several GPL-licensed Java and php solution for generating PDFs on the fly.

Some references


Hi James. Any progress on generating a PDF file output from wikka? -- Mike Bowen (GmBowen)

As you can see it picks the Page Name and Content fromm the database alright. The script needs a little refinement to format the page layout correctly and as I said earlier to restrict the results set from the sl query. The code is below.


class PDF extends PDF_MySQL_Table
function Header()
	$this->Cell(0,6,'Wikka Output To PDF',0,1,'C');
	//Ensure table header is output

//Connect to database

$pdf=new PDF();
//First table: put all columns automatically
$pdf->Table('select tag,body from main_wikka_pages');
//Second table: specify 2 columns,
//$pdf->Table('select tag,body from main_wikka_pages order by tag limit 0,10',$prop);

Thanks James. I've got an undergrad programmer hired for a few weeks in May....and I found the pdf generating code for wikini as well (which is now only in a google cache).....so I'm probably going to have him try and get pdf output working (using a handler). I found a "footnoting/endnoting" action for wikini too, so I'll get him working on that also. When either are working I'll post them up (um, I hope this is okay and you don't feel like your efforts are being hi-jacked.....some people are really touchy about such things, but I really do need PDF output from wikka.). Cheers. --GmBowen


  1. make a concept for ExportToPdf

R & OS pdf class


I think that a better way to investigate would be to look at the html2pdf package. This package seems to do pretty well with css and images. It is backended by gostscript to convert the page to postscript then to pdf. The downfall for this package is that it seems to be quite cpu intensive while generating the pdf. You can see a demo of it at http://pdf.shroom.net.

I invision this as a action that can be added to a float box and the pdf is returned when a user click on a pdf icon or something along these lines.

I also think that some code should be added to cache a generated pdf, and serve the cached pdf if the page has not changed since the pdf was generated.


CategoryDevelopmentHandlers CategoryDevelopmentArchitecture
There are 4 comments on this page. [Show comments]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki