[ de-na-ture
     - To change the nature or natural qualities of.
     - To render unfit to eat or drink without destroying usefulness in
       other applications, especially to add methanol to (ethyl alcohol).

[ What ]

denature is a perl program that attempts to convert an HTML page into XSL-FO which it then passes off to the FOP (Formatted Objects Formatter) to produce a PDF document. denature was originally developed at TrekLogic Software Solutions, but it was decided to release denature back to the community in the hopes that other people would find it useful.

denature trys to use any included CSS stylesheets to figure out the properties used in the document. The CSS processing in denature is not very mature and only handles a limited amount of the available CSS markup. The CSS support does not handle the contextual entries in a CSS document, and the CSS::Tiny module requires that all the :'s in a document have a space after them.

The HTML processing in denature is done by several perl modules: While the CSS processing is done by the CSS::Tiny module (cpan).

denature can add page breaks into the output pdf file. The placement of the page breaks is controlled by comments inside the HTML file. When a page break is desired place a <!-- PAGEBREAK --> command and a new page will be started before the next block of text. This can have funny consequences if the pagebreak is place inside a table data cell, so be careful where the break is placed.

The drawing of the checkboxes and radio buttons is handled through the use of simple SVG (scalable vector graphics). Of the other <form> elements, only text and textarea are handled, these are both just printed as normal text. <option> tags are ignored.

[ Installation / Execution ]

       denature [-i dir] [-c dir] [-l] [-f] [-e] [-w] [-d] [-h] input output

       -i dir -- image directory.
            Directory where images used in the HTML document are located.

       -c dir -- css file directory.
            Directory where the CSS file used is located, if needed.

       -l -- landscape mode.
            Will attempt to print the PDF as a landscape page (EXPERIMENTAL).

       -f -- footer.
            Will print a footer on the bottom of each page. The footer is of the
		 p. .

       -e -- header.
            Will print a header on the top of each page containing the
            <title></title> contents.

       -w -- warning.
            Will print out warning information.

       -d -- debug.
            Will print out debug information (this includes warnings). Only
            needed for development.

       -h -- help.
            Prints out a brief help message.

       There are several external dependancies which denature requires to exe-
       cute. They are:

       HTML-Tagset (perl module)
       HTML-Parser (perl module)
       HTML-Tree (perl module)
       CSS::Tiny (perl module)

       The perl modules should be available through CPAN,
       while FOP is available from

       Once all the requirements are installed two variables at the top of the
       denature script need to be set to the FOP and JDK install directories.
       The variables are:

            The directory that contains the script.

            The directory that contains the JDK (This is the same as the
            JAVA_HOME environment variable).  The the JDK version required
            should be specified on the FOP website.

       Once these variables are set, denature should work correctly.

[ Contact info ]

If you have any questions or comments about the denature program, you can either email me directly at the address below, or send a message to the mailing list (Available through the Sourceforge project page, see Resources section).
  • email:
  • icq: 2694979

[ License ]

denature has been released under the GPL v2. Which can be viewed online here. As the program is GPL, the authors take no responsability for any problems with the program. Use it at your own risk.

[ Resources ] Logo

This page copyright 2003, Dan Sinclair