pavan_pothuru has asked for the wisdom of the Perl Monks concerning the following question:
Hi, Generating the pdf file but the image or content is not aligned to the top left corner. HTML file consists of the images & content. Please find the below code,
open(OUTHTML,"test.html); @pdf_lines = <OUTHTML>; close(OUTHTML); my $htmldoc = new HTML::HTMLDoc(); # $htmldoc->set_input_file("$filename"); $htmldoc->set_page_size('letter'); $htmldoc->set_top_margin('top',-500,-500); $htmldoc->set_bottom_margin('bottom',-500,-500); $htmldoc->set_left_margin('left',-400,-400); $htmldoc->set_right_margin('right',-400,-400); $htmldoc->set_pagemode('pagemode','fullscreen'); $htmldoc->set_html_content(qq~@pdf_lines~); $htmldoc->get_html_content(); $htmldoc->set_input_file($fl_name_new); $htmldoc->get_input_file(); $htmldoc->set_header('.', '.', '.'); $htmldoc->set_footer('.', '.', '.'); $htmldoc->embed_fonts('embedfonts',''); $htmldoc->no_embed_fonts(); my $pdf = $htmldoc->generate_pdf(); #print $pdf->to_string(); $pdf->to_file("test.pdf");
Thanks. Regards, Pavan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PDF generation based on the HTML
by Khen1950fx (Canon) on Jan 30, 2010 at 10:25 UTC | |
by johngg (Canon) on Jan 30, 2010 at 17:15 UTC | |
|
Re: PDF generation based on the HTML
by ww (Archbishop) on Jan 30, 2010 at 21:02 UTC |