diff --git a/table_demo b/table_demo index 5069de1..2e72409 100755 --- a/table_demo +++ b/table_demo @@ -26,15 +26,25 @@ date_default_timezone_set("America/Los_Angeles"); //require_once('tcpdf_include.php'); $outfile = __DIR__ . '/pdflib_table_output.pdf'; -// page placement defaults -$pageTopYPortrait = 750; -$pageTopYLandscape = 570; - +define("PAGE_WIDTH_LETTER", 612); +define("PAGE_HEIGHT_LETTER", 792); +define("PAGE_WIDTH_A4", 595); +define("PAGE_HEIGHT_A4", 842); // table params $tbl = 0; $rowmax = 50; $colmax = 5; -$llx= 50; $lly=50; $urx=550; $ury=800; + +// page placement defaults +$letterPageTopYPortrait = 752; +$letterPageTopYLandscape = 592; +$letterPageRightPortrait = 592; +$letterPageRightLandscape = 752; +// lower left X, lower left Y, upper right X, upper right Y +// A4 paper size +//$llx= 50; $lly=50; $urx=550; $ury=800; +// Letter paper size +$llx= 50; $lly=50; $urx=550; $ury=$letterPageTopYPortrait; // wrap PDFlib usage in a try{} block try { @@ -44,7 +54,9 @@ try { $pdf->set_option("errorpolicy=return"); $pdf->set_option("stringformat=utf8"); // set up the license key; Linux x86_64 - $pdf->set_option("license=L900202-010053-139026-P52782-GB5G52"); + // This will be skipped on Macs + if ( php_uname('s') === "Linux" ) + $pdf->set_option("license=L900202-010053-139026-P52782-GB5G52"); // all paths in 'searchpath' need to be inside curly braces // multiple curly-braced paths in $searchpath need to be separated with