Created
January 13, 2014 14:42
-
-
Save pbowyer/8401485 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
set_time_limit(0); | |
error_reporting(E_ALL); | |
define("_MPDF_TEMP_PATH", '/tmp/'); | |
/* | |
My composer.json | |
{ | |
"require": { | |
"mpdf/mpdf": "dev-master" | |
} | |
} | |
*/ | |
require 'vendor/autoload.php'; | |
$mpdf = new mPDF('', 'A4-L'); | |
$mpdf->dpi = 300; | |
$mpdf->img_dpi = 300; | |
$mpdf->autoLangToFont = true; | |
$mpdf->SetMargins('17mm', '17mm', '15mm'); | |
ob_start(); | |
?> | |
<html><head> | |
</head> | |
<body> | |
<h1>This line is indented and shouldn't be</h1> | |
<!--mpdf | |
<htmlpagefooter name="myfooter"> | |
<div style="float: left; width: 25mm; font-size: 9pt; text-align: left; padding-top: 3mm;"> | |
Page {PAGENO}</div> | |
<div style="float: right; width: 50mm; text-align: right; font-size: 9pt; padding-top: 3mm;"> | |
© Copyright copy</div> | |
</htmlpagefooter> | |
<sethtmlpagefooter name="myfooter" value="on" /> | |
mpdf--> | |
</body> | |
</html> | |
<?php | |
$mpdf->WriteHTML(ob_get_clean()); | |
$mpdf->Output(); exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can use this API with HTML5 SVG tags?
i want to create pdf for SVG tags which is dynamic ? can i?