TCPDF Custom page size

前端 未结 7 1544
执笔经年
执笔经年 2020-12-09 08:35

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.

7条回答
  •  时光取名叫无心
    2020-12-09 09:19

    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);
    

提交回复
热议问题