About Sitellite       Screenshots       Downloads       Forge      Documentation       Community       Support

You are here: Home / Documentation / Template Modes

Template Modes

Another Quick Output Mode: PDF

The 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
Page 2: Content Filters
Page 3: Creating an Alternate Output Mode: DocBook
Page 4: Another Quick Output Mode: PDF

All Tutorials

Members

Note: You can use your SitelliteForge.com account here and vice versa.

Username

Password

Forgot your password?

Not a member? Click here to register

Sitellite 5 Beta


Copyright © 2008, SIMIAN systems Inc.
All rights reserved. Privacy policy
Some of the icons on this site were created by the Gnome Project.