Hi monks,
I need to convert html to pdf. I use these below code to convert this html to pdf files. Here, for the sample site http://www.msn.com i save as the site page and give as argument 0 and mentioned the image path as argument 1. I am getting images with html text as pdf output file looks good. But, css is not working fine..i think means css flow is not seems exact in pdf as seems in site..Can anyone give me some ideas or refer opensource tool to do...
#!/usr/local/bin/perl
use HTML::HTMLDoc;
my $htmldoc = new HTML::HTMLDoc();
$htmldoc->set_input_file($ARGV[0]);
$htmldoc->path($ARGV[1]);
my $pdf = $htmldoc->generate_pdf();
$pdf->to_file($ARGV[2]);
#!/usr/local/bin/perl
use HTML::HTMLDoc;
my $htmldoc = new HTML::HTMLDoc();
$htmldoc->set_input_file($ARGV[0]);
$htmldoc->path($ARGV[1]);
my $pdf = $htmldoc->generate_pdf();
$pdf->to_file($ARGV[2]);