in reply to How to make work HTML::HTMLDoc on browser?
I have tweaked your code and this works for me. Remember to use strict and warnings especially important if you have an error but nothing is appearing in the logs. For delivering a pdf to a browser you need a content type header.
#!/usr/bin/perl use strict; use warnings; use CGI; my $cgi=new CGI; print $cgi->header( -type => 'application/pdf' ); use HTML::HTMLDoc; my $htmldoc = new HTML::HTMLDoc(); $htmldoc->set_html_content('<html><body>A PDF file</body></html>'); my $pdf = $htmldoc->generate_pdf(); print $pdf->to_string(); $pdf->to_file('newpdfdoc.pdf');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to make work HTML::HTMLDoc on browser?
by elavarasan (Acolyte) on Apr 16, 2013 at 07:25 UTC | |
by rnewsham (Curate) on Apr 16, 2013 at 07:35 UTC | |
by elavarasan (Acolyte) on Apr 16, 2013 at 08:18 UTC | |
by marto (Cardinal) on Apr 16, 2013 at 10:46 UTC | |
by divinafaudan (Initiate) on Aug 02, 2013 at 13:24 UTC | |
by rnewsham (Curate) on Aug 02, 2013 at 22:59 UTC | |
by divinafaudan (Initiate) on Aug 05, 2013 at 00:24 UTC | |
|