Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TCPDF Custom page size

Tags:

tcpdf

This example on tcpdf's website shows how to use page formats like A4, A5 etc, but how do I set tcpdf to use custom sizes like 175mm x 266 mm?

Solutions appreciated.

like image 520
abel Avatar asked Oct 16 '10 12:10

abel


People also ask

How do I upload an image to Tcpdf?

$tcpdf = new TCPDF_TCPDF(); $img = file_get_contents(Mage::getBaseDir('media') . '/dhl/logo. jpg'); $PDF_HEADER_LOGO = $tcpdf->Image('@' . $img);//any image file.


1 Answers

No editing of the class is require... tcpdf doesn't accept a width/length parameter, it just accepts two lengths and determines which is which using the layout (either Portrait or Landscape)

$pageLayout = array($width, $height); //  or array($height, $width)  $pdf = new TCPDF('p', 'pt', $pageLayout, true, 'UTF-8', false); 
like image 66
Sam Avatar answered Sep 21 '22 19:09

Sam