Title / Description
Code <?php // convert a web page and store the generated PDF into a $pdf variable //For the orientation chose Landscape or Portrait at the end of the url //Set the margin size with the mtop, mleft, mright & mbot value (default 10) $pdf = file_get_contents('http://api.simplehtmltopdf.com/?link=http://www.google.com&orientation=Portrait&mtop=10&mright=10&mleft=10&mbot=10'); // set HTTP response headers header("Content-Type: application/pdf"); header("Cache-Control: no-cache"); header("Accept-Ranges: none"); header("Content-Disposition: attachment; filename=\"your_pdf_name.pdf\""); // send the pdf that you create echo $pdf; ?>
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code