divinafaudan has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I am really confuse why does my codes did not work when tried to run it from the browser.However, it works perfectly when run from the command line. Please see my codes below
#!/usr/bin/perl5 use HTML::HTMLDoc; use strict; use warnings; use CGI; my $cgi=new CGI; print $cgi->header( -type => 'application/pdf' ); my $htmldoc = new HTML::HTMLDoc(); $htmldoc->set_html_content(qq~<html><body><table border=1><tr><td cols +pan=2>A PDF file</td></tr><tr><td>Column 1</td><td><img src='freight- +charge.jpg'></td></tr></table></body></html>~); # $htmldoc->set_input_file($filename); # alternative to use a present +file from your fs my $pdf = $htmldoc->generate_pdf(); print $pdf->to_string(); $pdf->to_file('foo.pdf');
I am getting no error, when i compiled it, the syntax is OK. Please help
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: html::htmldoc not working
by choroba (Cardinal) on Aug 01, 2013 at 15:22 UTC | |
by divinafaudan (Initiate) on Aug 01, 2013 at 17:15 UTC | |
by choroba (Cardinal) on Aug 02, 2013 at 13:31 UTC | |
|
Re: html::htmldoc not working
by rpnoble419 (Pilgrim) on Aug 01, 2013 at 20:07 UTC | |
by divinafaudan (Initiate) on Aug 02, 2013 at 13:18 UTC | |
|
Re: html::htmldoc not working
by glasswalk3r (Friar) on Aug 02, 2013 at 21:30 UTC |