View Full Version : convert html to PDF
sanhitasinha
08-11-2008, 07:25 AM
I want to convert a html page to pdf format. and the pdf file should get saved in a desired location fixed by the coder.
how to do so? plz help !
sobuj
08-11-2008, 01:32 PM
Hi Sanhita
There are quite a few html to pdf converters, you can google them out. The problem is it's difficult to find a tool that converts "as it is". The better bet would be, probably, to recreate the pdf files separately with a look you desire.
I want to convert a html page to pdf format. and the pdf file should get saved in a desired location fixed by the coder.
how to do so? plz help !
You should state clearer that you want it done by php, if that is what you want
Moglizorz
09-03-2008, 02:44 PM
Install Mozilla Firefox, if you don't have it already, and get this addon; http://www.pdfdownload.org/
It copys the page as-is to PDF,, straight from Mozilla.
Roger82
11-21-2008, 03:11 PM
try to use Xml2PDF
refer http://www.alt-soft.com
This may help you:
HTML to PDF with PHP, Java or ASP:
dancrintea.ro/html-to-pdf/
PDF specifies static, printed, visual documents, while HTML specifies fluid, on-screen, semantic documents. They aren't literally convertible. You may be able to get a possible conversion, but there's no guarantee that it'll be the one you want, or even one that looks decent.
JShor
09-05-2009, 10:34 PM
Please don't spam the forum. As for creating PDF documents on the fly, I posted code to someone who had a similar inquiry, here:
http://www.dynamicdrive.com/forums/showthread.php?t=47714
<?php
$html= "<h1>hello</h1>"; //To add more html code use $html.= yourcode; in the next line
define('HTML2FPDF_VERSION','3.0(beta)');
define('RELATIVE_PATH','fpdf/');
define('FPDF_FONTPATH','font/');
require_once(RELATIVE_PATH.'fpdf.php');
require_once(RELATIVE_PATH.'htmltoolkit.php');
require_once(RELATIVE_PATH.'html2fpdf.php');
$pdf = new HTML2FPDF();
$pdf->WriteHTML($html);
$name="doc.pdf";
$pdf->Output($name);
?>
anjd you'd need this extension:
http://sourceforge.net/projects/html2fpdf/files/
HTH:)
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.