TCPDF Custom page size

前端 未结 7 1548
执笔经年
执笔经年 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:00

    On the newer TCPDF version you can define the page size in multiple ways:

    • All standard page formats are already defined (more than 300 types).
    • You can simply define a page size by defining an array with 2 numbers: width, height (regardless the page orientation).
    • Alternatively, you can define advanced page details (MediaBox, Cropbox, BleedBox, TrimBox, ArtBox) as explained on the documentation of the setPageFormat() method at http://www.tcpdf.org.

    Check also the default examples no. 28 and 60 at http://www.tcpdf.org.

提交回复
热议问题