Results 1 to 8 of 8

Thread: how to convert html page to PDF using PHP

  1. #1

    Thread Starter
    Lively Member rasana's Avatar
    Join Date
    Jan 2007
    Location
    Mumbai, (India)
    Posts
    94

    Unhappy how to convert html page to PDF using PHP

    Hello All,

    Is there any function to convert html page to PDF format?
    If yes then how to use dat function?

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: how to convert html page to PDF using PHP

    Not a function, no. But there are libraries that do this.

    http://www.t u f a t.com/s_html2ps_html2pdf.htm
    http://www.digitaljunkies.ca/dompdf/

    Edit: Oh dear, the profanity filter tries to kill the first domain ... remove the spaces.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Lively Member rasana's Avatar
    Join Date
    Jan 2007
    Location
    Mumbai, (India)
    Posts
    94

    Re: how to convert html page to PDF using PHP

    Quote Originally Posted by CornedBee
    Not a function, no. But there are libraries that do this.

    http://www.t u f a t.com/s_html2ps_html2pdf.htm
    http://www.digitaljunkies.ca/dompdf/

    Edit: Oh dear, the profanity filter tries to kill the first domain ... remove the spaces.
    Hi,
    I've gone through d websites u mentioned, but it provides pdf converter.
    actually i'm working on project where I need to convert entry form into pdf format, so i'll have to code to convert html or php page to PDF format.

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: how to convert html page to PDF using PHP

    I don't get your problem.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    354

    Re: how to convert html page to PDF using PHP

    Well if you really want to make it hard on yourself
    Enjoy...

    http://www.php.net/manual/en/ref.pdf.php

  6. #6

    Thread Starter
    Lively Member rasana's Avatar
    Join Date
    Jan 2007
    Location
    Mumbai, (India)
    Posts
    94

    Re: how to convert html page to PDF using PHP

    Quote Originally Posted by superbovine
    Well if you really want to make it hard on yourself
    Enjoy...

    http://www.php.net/manual/en/ref.pdf.php
    Hi,
    I've seen http://www.php.net/manual/en/ref.pdf.php
    but code which is provided there, creates PDF file.
    I want html page to be converted in PDF format.
    E.G.

    HTML Code:
    <html>
    <body>
    <table>
            <tr>
                 <td>Name</td>
                 <td><input type="text" name="txtname" size=20 /></td>
          </tr>
         
         <tr>
                 <td>Email</td>
                 <td><input type="text" name="txtemail" size=20 /></td>
          </tr>
         
          <tr>
                 
                 <td><input type="Button" name="genbutton" value="Generate PDF" /></td>
          </tr>
    
    
    </table>
    </body>
    </html>
    So, when I click on "Generate PDF " button this page should be converted in PDF format.

  7. #7
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: how to convert html page to PDF using PHP

    the original link that cornedbee posted, this one, does exactly what you want. i'm not sure why you overlooked it before.

  8. #8
    Hyperactive Member
    Join Date
    Oct 2006
    Posts
    354

    Re: how to convert html page to PDF using PHP

    Quote Originally Posted by kows
    the original link that cornedbee posted, this one, does exactly what you want. i'm not sure why you overlooked it before.

    Yeah I know, it is a full API with good documentation. Even if he used the php.net page, there is enough there to create his project.
    Last edited by superbovine; Feb 1st, 2007 at 06:42 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width