|
You are here: Home / Template Modes |
Template ModesAnother Quick Output Mode: PDFThe PDF output mode is very easy to create, as the function necessary for HTML-to-PDF conversion is somewhat built-in. Sitellite provides a wrapper library in ext.htmldoc around the HTMLDoc HTML-to-PDF command line conversion too, available under a GPL license from: http://www.htmldoc.org/ The installation process for HTMLDoc itself should be straight-forward on most Unix systems, including Mac OS X: tar -zxf htmldoc.tar.gz cd htmldoc ./configure make sudo make install Now for the fun part. Creating a PDF output mode is as simple as creating the necessary pdf.default.tpl template (you can just copy your html.default.tpl for testing), and adding the following INI block to your modes.php file: [pdf] content_type = application/pdf filter 1 = "final: ext.htmldoc" You should now be able to view a PDF of your home page at: http://www.example.com/index/mode.pdf If you do run into problems, make sure that your command line htmldoc binary is somewhere in PHP's PATH environment variable. You will find useful information on the HTMLDoc web site about customizing the HTML of your template to control the PDF output. Note that where the HTMLDoc documentation says to put comments, use xt:note tags instead. For example: <xt:note>HEADER LEFT "Site Name"</xt:note> As you can see, the modes.php file allows for some powerful control over Sitellite's ability to publish content in multiple formats. Page 1: File Format |
|
Copyright © 2009, SIMIAN systems Inc. All rights reserved. Privacy policy Some of the icons on this site were created by the Gnome Project. |