[ic] Problems generating PDF:s on the fly with HTML::HTMLDoc

Jonathan Clark jonc at webmaint.com
Thu Nov 27 15:08:17 EST 2003

> I have been trying to create an usertag that would return a PDF
> on-the-fly (by using HTMLDoc and the HTML::HTMLDoc CPAN module).
> My problem is that I can't get this script to work within IC. It
> works perfectly when I run it from a separate Perl-script, but
> running it as an usertag creates only an empty file (0 bytes) or
> returns nothing.
> The perldoc for HTML::HTMLDoc explains that there are problems
> when using the module in a "mod_perl-environment" because of some
> troubles that the IPC::Open3 module has with returning
> standard-output. This problem can be solved so that it wont use
> IPC::Open3, but that did not help (it creates that empty file).
> What does a "mod_perl-environment" mean? I assume that IC is
> running in this mode, but is it possible to by-pass this?
> I'm also curious if anyone is using this combination of these
> modules (or maybe something else) to produce PDF-files on-the-fly.

I have used HTMLDOC on the Helpem content management system which is built
in Interchange. Having said that, I didn't bother to call HTMLDOC from
within IC as it is just producing a PDF on the fly from an IC html page.
>From the samples I used:

<begin cgi script>
# The "options" variable contains any options you want to pass to HTMLDOC.

options="-t pdf "

# Tell the browser to expect a PDF file...

echo "Content-Type: application/pdf"
echo ""

# Run HTMLDOC to generate the PDF file...

htmldoc $options http://${SERVER_NAME}/onepage.html?$QUERY_STRING

<end cgi script>

Here's an example of a PDFed IC generated document:


Jonathan Clark
Webmaint.com - Building Clever Websites   http://www.webmaint.com/
Webmaint.net - Business Web Hosting       http://www.webmaint.net/

More information about the interchange-users mailing list