![]() | HTMLDOC 1.8.27 Software Users Manual | |
| Home · Articles & FAQs · Bugs & Features · Documentation · Download · Forums | Login | |
[ Comments | Contents | Previous | Next ] Calling HTMLDOC from PerlPerl scripts offer the ability to generate more complex reports, pull data from databases, etc. The easiest way to interface Perl scripts with HTMLDOC is to write a report to a temporary file and then execute HTMLDOC to generate the PDF file. Here is a simple Perl subroutine that can be used to write a PDF report to the HTTP client:
sub topdf {
# Get the filename argument...
my $filename = shift;
# Make stdout unbuffered...
select(STDOUT); $| = 1;
# Tell HTMLDOC not to run in CGI mode...
$ENV{HTMLDOC_NOCGI} = 1;
# Write the content type to the client...
print "Content-Type: application/pdf\n\n";
# Run HTMLDOC to provide the PDF file to the user...
system "htmldoc -t pdf --quiet --webpage $filename";
}
[ Comments | Contents | Previous | Next ] User Comments [ Add Comment ]No comments for this page. | ||
| Copyright 1997-2008 by Easy Software Products. HTMLDOC and <HTML>DOC are the trademark property of Easy Software Products. HTMLDOC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. | ||