Commit ab54ad1e9404603e9cc9d2a12d4c5b8f0e452ada
1 parent
3c0f907a9c
table_demo: use PDFlib constant definitions when creating new pages
- PDFlib lets you use "constants" for certain values, like page height/width for "Letter" size pages
Showing 1 changed file with 10 additions and 4 deletions Side-by-side Diff
table_demo
View file @
ab54ad1
... | ... | @@ -57,7 +57,7 @@ |
57 | 57 | . "encoding=unicode "; |
58 | 58 | |
59 | 59 | // START PAGE 1 |
60 | - $pdf->begin_page_ext(612, 792, ''); | |
60 | + $pdf->begin_page_ext(0, 0, 'width=letter.width, height=letter.height'); | |
61 | 61 | |
62 | 62 | // create bookmarks first thing |
63 | 63 | $action = $pdf->create_action("GoTo", "destination={page=1}"); |
64 | 64 | |
... | ... | @@ -117,14 +117,20 @@ |
117 | 117 | // END PAGE 2 |
118 | 118 | $pdf->end_page_ext(''); |
119 | 119 | |
120 | + // START PAGE 3 | |
121 | + $pdf->begin_page_ext(0, 0, 'width=letter.width, height=letter.height'); | |
122 | + | |
123 | + // END PAGE 3 | |
124 | + $pdf->end_page_ext(''); | |
125 | + | |
120 | 126 | // close the document |
121 | 127 | $pdf->end_document(''); |
122 | 128 | } |
123 | 129 | |
124 | 130 | catch (PDFlibException $e) { |
125 | - die("PDFlib exception occurred in sample:\n" . | |
126 | - "[" . $e->get_errnum() . "] " . $e->get_apiname() . ": " . | |
127 | - $e->get_errmsg() . "\n"); | |
131 | + die("PDFlib exception occurred in sample:\n" . | |
132 | + "[" . $e->get_errnum() . "] " . $e->get_apiname() . ": " . | |
133 | + $e->get_errmsg() . "\n"); | |
128 | 134 | } |
129 | 135 | |
130 | 136 | catch (Exception $e) { |