in reply to PDF generation based on the HTML

On the off chance you're running windows, check the bug reports, including https://rt.cpan.org/Public/Bug/Display.html?id=20797 and https://rt.cpan.org/Public/Bug/Display.html?id=49700.

Even Khen1950fx's code above (with the open mode at line 5 changed to:

open( INHTML, "<", "test.htm" or die "can't open test.htm, $!" ) or die "Can't read new2col.html $!" ;

produces a 0 byte pdf from the CLI on w32.

Re johngg's response, the doc says:

"Normaly this module uses IPC::Open3 for communacation (sic) with the HTMLDOC process. However, in mod_perl-environments (emphasis supplied) there appear problems with this module because the standard-output can not be captured. For this problem this module provides a fix doing the communication in file-mode."
"For this you can specify the parameter mode in the constructor: my $htmldoc = new HTMLDoc('mode'=>'file', 'tmpdir'=>'/tmp');"

Even if your example is meant to run under mod_perl you may wish to review your line 5. If not, johngg's nudge warrants your careful attention.

Your line 13

$htmldoc->set_input_file('/user/Desktop/PDF');

is also suspect as the doc says:

set_input_file($input_filename)
this is the function to set the input file name. It will also switch the operational mode to 'file'.

which opens "a whole 'nuther kettle of fish" (Ugly ones!) If your target pages don't use css, you may have better luck with http://search.cpan.org/dist/PDF-FromHTML/. Audrey Tang is also the author of another possible option, html2pdf.pl (Update: merely a wrapper).

Update above: to correct and clarify re html2pdf.pl