Test
Php
code posted
by
me
created at 03 Oct 11:55
Edit
|
Back
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<?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; ?> |
732 Bytes in 3 ms with coderay