Details
Description
I tried to create a PDF with custom size and checked out what format my notation should be. According to the constants and the descriptions I could find i is "x:y" and so I did:
$objPage = new Zend_Pdf_Page('100:100');
this resulted in a fatal error: Uncaught exception 'Zend_Pdf_Exception' with message 'Wrong pagesize notation.'.
And it goes wrong in this piece of code on line 303 of Zend/Pdf/Page.php :
$pageDim = explode(':', $param1);
if(count($pageDim) == 3) {
$pageWidth = $pageDim[0];
$pageHeight = $pageDim[1];
}
the count is expected to be 3, but this should be 2 ofcourse.
A little update
{notation}const SIZE_A4 = '595:842:';
const SIZE_A4_LANDSCAPE = '842:595:';{notation}
these constants do have the notation "x:y:" instead of the asked "x:y" notation at line 299:
{notation}switch (strtolower($param1)) {
case 'a4':
$param1 = Zend_Pdf_Page::SIZE_A4;
break;
<-->
default:
// should be in "x:y" form
}{notation}
So the comment should be changed to be "x:y:" or the count should be set to 2 (and then the constants need to be changed).