Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: How to make work HTML::HTMLDoc on browser?

by rnewsham (Curate)
on Apr 16, 2013 at 07:35 UTC ( [id://1028835]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to make work HTML::HTMLDoc on browser?
in thread How to make work HTML::HTMLDoc on browser?

It sounds like your problem may be with the install of htmldoc on your system. Are you able to use htmldoc from the command line to generate a valid pdf? Are there any errors reported in the logs from my example code?

  • Comment on Re^3: How to make work HTML::HTMLDoc on browser?

Replies are listed 'Best First'.
Re^4: How to make work HTML::HTMLDoc on browser?
by elavarasan (Acolyte) on Apr 16, 2013 at 08:18 UTC

    no in command line no error it generates valid pdf

      Now is the time to start debugging. I've already given you a link which gives a step by step guide to doing so, you're going to actually have to take the time to read and understand this. Go through each test/method specified to locate the problem.

Re^4: How to make work HTML::HTMLDoc on browser?
by divinafaudan (Initiate) on Aug 02, 2013 at 13:24 UTC

    Hi rnewsham , I have the same issue with elavarasan. Please help me solve it. I've been working on this for more than a week now. 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('mode'=>'file', 'tmpdir'=>'/tmp'); $htmldoc->set_permissions('all'); $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 have tested your code and it works for me.

      Assuming you have already followed my earlier suggestions, for tracing the problem, I think the best think to do is try to contact the creators of the module.

        Did it work when you run it from the browser? what browser did you use? I already contacted the author and he gave a suggestion, then i followed it but still it didn't work perfectfully. Well, it can generate the pdf file with no contents, always 0 bytes. Is this something to do with our server configuration?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1028835]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-19 14:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found