About Sitellite       Screenshots       Downloads       Forge      Documentation       Community       Support

You are here: Home / Documentation / PDF Output in Sitellite

PDF Output in Sitellite

Step 4: Calling the PDF Maker

Note: As of Sitellite 4.2, steps 4 & 5 have been simplified to the following:

Add the following block to your inc/html/yourtemplates/modes.php file:
[pdf]
content_type = application/pdf
filter 1 = "final: ext.htmldoc"
Next, to trigger the "pdf" output mode, simply add /mode.pdf or ?mode=pdf to your URL string, like this:
http://www.example.com/index/about_us/mode.pdf
http://www.example.com/index/siteglossary-app?mode=pdf
For posterity, below is the former technique for steps 4 & 5:

There is already a PHP wrapper around HTMLDoc as well as a box in Sitellite that can be used to generate your PDF output.  This box is located in sitellite/util/pdfmaker and takes 2 parameters: url and options.  The latter is optional, but a url is required.  There are also two ways of specifying the url value, as a full URL (ie. "http://...") or starting with the "/index".  In this way, you can even include PDF versions of links outside of Sitellite.

An example call to the PDF maker might be:

http://www.example.com/index/sitellite-util-pdfmaker-action?url=/index/mode.pdf

Load that into your browser and you should see a PDF of your main index page open up using the new output mode that you created.  Note that the /mode.pdf has to be specified in the url parameter for that page to use the pdf output mode.

Step 5: Linking to the PDF Maker

To link to the PDF maker in your main template, simply insert the following as a link somewhere:

<a href="${site/prefix}/index/sitellite-util-pdfmaker-action
?url=${site/current}/mode.pdf">PDF Version</a>

Note that the line break is simply for preserving the page width for this article and should be removed.  You could also use a PDF icon graphic to integrate the button into your web site's overall design.

As you can see, Sitellite combined with HTMLDoc provides a very powerful PDF publishing solution for your web site.  Now any page on your site can be saved as a high quality PDF document, suitable for printing as offline information references or emailing product information to a potential client.

Page 1: Step 1: Installing HTMLDoc
Page 2: Step 2: Creating a New Output Mode
Page 3: Step 4: Calling the PDF Maker

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.