This is an archived forum post. The information may be outdated. Contact us if you have any questions.
//call the pdf API include 'pdfcrowd.php'; try { //build the pdf, headers, margins, etc $client = new Pdfcrowd("my username", "my api key"); $client->setPageWidth("210mm"); $client->setPageHeight("297mm"); $client->setVerticalMargin("40mm"); $client->setHorizontalMargin("15mm"); $client->setPageNumberingOffset(1); $client->setHeaderHtml('<embed src="http://www.etask.it/images/email/MC_header.jpg" width="100%" />'); $client->setFooterhtml('<p><embed src="http://www.etask.it/images/email/MC_footer.jpg" /></p><p style="text-align:center">%p</p>'); $client->setHeaderFooterPageExcludeList(1); $client->convertURI('http://www.etask.it/pdfdocs/maturity-report.html', fopen('pdfdocs/maturity-report.pdf', 'wb'));
$html=' <body style="margin:0;padding:0"> <div style="background-repeat:no-repeat; background-size:794px 1122px; contain;background-image:url(http://www.etask.it/images/maturity-spider/MC_page_wierd.jpg); height:1122px"> </div> </body>'; $client->setPageWidth("210mm"); $client->setPageHeight("297mm"); $client->setVerticalMargin(0); $client->setHorizontalMargin(0); $pdf = $client->convertHtml($html);
px = 96 * mm / 25.4