Results 1 to 8 of 8

Thread: convert html to PDF

  1. #1
    Join Date
    Aug 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow convert html to PDF

    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 !

  2. #2
    Join Date
    Aug 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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.

  3. #3
    Join Date
    Mar 2008
    Posts
    218
    Thanks
    7
    Thanked 19 Times in 19 Posts

    Default

    Quote Originally Posted by sanhitasinha View Post
    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

  4. #4
    Join Date
    Mar 2007
    Posts
    68
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    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.

  5. #5
    Join Date
    Nov 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    try to use Xml2PDF
    refer http://www.alt-soft.com

  6. #6
    Join Date
    Dec 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default HTML to PDF with PHP, Java or ASP

    This may help you:

    HTML to PDF with PHP, Java or ASP:
    dancrintea.ro/html-to-pdf/

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    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/s...ad.php?t=47714

    PHP Code:
    <?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
    - Josh

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •