PDF in PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • weetat.yeo@gmail.com

    #1

    PDF in PHP

    Hi all ,

    I have trying to convert a PHP file to PDF.
    Search the net , found HTML_toPDF open source tools , which convert
    html file to PDF.
    Tried to product , it work seamless without any error.

    Howeve , for my case , when user click the search button to 'search
    items' , the data are display in the listall.php. On listall.php ,
    there are 'print' button which print the listall.php.

    Because the HTML_toPDF only convert html to PDF, i need to find a way
    how to convert the listall.php to listall.html dynamically before i
    called the HTML_toPDF functions.

    Anyone have ideas how to do it or suggestions is much appreciated .

    Thanks
    - weetat

  • Juliette

    #2
    Re: PDF in PHP

    weetat.yeo@gmai l.com wrote:
    Hi all ,
    >
    I have trying to convert a PHP file to PDF.
    Search the net , found HTML_toPDF open source tools , which convert
    html file to PDF.
    Tried to product , it work seamless without any error.
    >
    Howeve , for my case , when user click the search button to 'search
    items' , the data are display in the listall.php. On listall.php ,
    there are 'print' button which print the listall.php.
    >
    Because the HTML_toPDF only convert html to PDF, i need to find a way
    how to convert the listall.php to listall.html dynamically before i
    called the HTML_toPDF functions.
    >
    Anyone have ideas how to do it or suggestions is much appreciated .
    >
    Thanks
    - weetat
    >

    Have a look at the output buffering functions like ob_start,
    ob_get_contents etc

    Run the page like you normally would, but add the ob_start at the
    beginning and instead of printing to the screen you capture all you
    output at the end.
    Save to a temporary html file & presto !

    Comment

    Working...