Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

PDF output

I just started playing around with CityDesk last weekend, looking for a solution for producing a website, a  HTML helpfile, an online manual and a PDF manual all from one source.

The example of the helpfile posted here was great for solving that particular issue. However, I'm particularly pleased with the solution for pdf output. I just wanted to share it incase anybody else is looking for a similar solution. or can suggest improvements.

The good news it that it is all free and open source, although there are other ways to licence it.

The program I found is called HTMLDOC at 

The free version doesn't have a command line interface but it saves its set up in a simple file which can be built easily inside CityDesk.

1. Install HTMLDOC and save a file. This will have  a .book file extention.

2. Copy the first 2 lines of this file and paste them into a new file in CityDesk.

3. Add the following lines after that
{$foreach x in (all) $}{$$}

4. Name this file something like

5. Add  "book" to the list of extentions that CityDesk recognises and enable scripting for it.

6. Make sure that there is at least one H1 tag in the index of your site and that subsections have H2 tags, H3 etc. Each H1 tag is turned into a first level bookmark, H2 etc tags are added as children and so on, so that you can nicely control the structure of the pdf file. Links are preserved.

After publishing to a local disk, opening the file and clicking "Generate" gives the PDF file. Options for this could be added to the menu (unfortunately only having a %1 variable to put in limits it slightly, a ($Path$) variable would be nice so that you could put something like ($Path$)/

Apart from the free version not having a command line interface, there may be some limitations with what tags are recognised. On the whole, I think it looks like a very easy way to make PDF

Tuesday, November 19, 2002

*  Recent Topics

*  Fog Creek Home