If you want to define a new page by name (a fully custom page that has nothing to do with it), then here's how to do it:
- Go to /tcpdf/include/tcpdf_static.php
- Scroll to line 478
Add personalized sheets in the same format
public static function getPageSizeFromFormat($format) { switch (strtoupper($format)) { // ISO 216 A Series + 2 SIS 014711 extensions case 'A0' : {$pf = array( 2383.937, 3370.394); break;} case 'A1' : {$pf = array( 1683.780, 2383.937); break;} case 'A2' : {$pf = array( 1190.551, 1683.780); break;} case 'A3' : {$pf = array( 841.890, 1190.551); break;} case 'A4' : {$pf = array( 595.276, 841.890); break;} case 'A5' : {$pf = array( 419.528, 595.276); break;} case 'A6' : {$pf = array( 297.638, 419.528); break;}
Just add another case with your custom size.
case 'SQUARE' : {$pf = array( 297.638, 297.638); break;} case 'SMALLSQUARE' : {$pf = array( 100.00, 100.00); break;}
Then use the regular constructor to invoke the new page:
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, 'SQUARE', true, 'UTF-8', false);
source share