ZF-12340: Zend_Pdf_Canvas is not fully implemented
I tried to create a canvas to place an image but nothing happens. I looked at the internals of the Zend_Pdf_Canvas_Abstract::drawCanvas() method and it seems that the variable $contentsToDraw is not used.
Here is the code of my example :
$pdf = new Zend_Pdf(); $page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4); $canvas = New Zend_Pdf_Canvas($page->getWidth(), $page->getHeight()); $canvas->setFillColor(new Zend_Pdf_Color_Html('#000000')); $canvas->drawRectangle(0, $canvas->getHeight(), $canvas->getWidth(), 0, Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE); $page->drawCanvas($canvas, 0, $page->getHeight()); $pdf->pages = $page; header("Content-Disposition: inline; filename=canvas.pdf"); header("Content-type: application/pdf"); echo $pdf->render();