/** * Draw Line for page * * @param Zend_Pdf_Page $page * @return void */ protected function _drawLine(Zend_Pdf_Page $page) { //$this->_setFontRegular($page, 9); //$page->setLineColor(new Zend_Pdf_Color_GrayScale(0)); $page->setLineWidth(1); $page->drawLine(25, $this->y - 15, 570, $this->y - 15); }
public function testDrawing() { $pdf = new Zend_Pdf(); // Add new page generated by Zend_Pdf object (page is attached to the specified the document) $pdf->pages[] = $page1 = $pdf->newPage('A4'); // Add new page generated by Zend_Pdf_Page object (page is not attached to the document) $pdf->pages[] = $page2 = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_LETTER_LANDSCAPE); // Create new font $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA); // Apply font and draw text $page1->setFont($font, 36); $page1->setFillColor(Zend_Pdf_Color_Html::color('#9999cc')); $page1->drawText('Helvetica 36 text string', 60, 500); // Use font object for another page $page2->setFont($font, 24); $page2->drawText('Helvetica 24 text string', 60, 500); // Use another font $page2->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_TIMES), 32); $page2->drawText('Times-Roman 32 text string', 60, 450); // Draw rectangle $page2->setFillColor(new Zend_Pdf_Color_GrayScale(0.8)); $page2->setLineColor(new Zend_Pdf_Color_GrayScale(0.2)); $page2->setLineDashingPattern(array(3, 2, 3, 4), 1.6); $page2->drawRectangle(60, 400, 400, 350); // Draw circle $page2->setLineDashingPattern(Zend_Pdf_Page::LINE_DASHING_SOLID); $page2->setFillColor(new Zend_Pdf_Color_Rgb(1, 0, 0)); $page2->drawCircle(85, 375, 25); // Draw sectors $page2->drawCircle(200, 375, 25, 2 * M_PI / 3, -M_PI / 6); $page2->setFillColor(new Zend_Pdf_Color_Cmyk(1, 0, 0, 0)); $page2->drawCircle(200, 375, 25, M_PI / 6, 2 * M_PI / 3); $page2->setFillColor(new Zend_Pdf_Color_Rgb(1, 1, 0)); $page2->drawCircle(200, 375, 25, -M_PI / 6, M_PI / 6); // Draw ellipse $page2->setFillColor(new Zend_Pdf_Color_Rgb(1, 0, 0)); $page2->drawEllipse(250, 400, 400, 350); $page2->setFillColor(new Zend_Pdf_Color_Cmyk(1, 0, 0, 0)); $page2->drawEllipse(250, 400, 400, 350, M_PI / 6, 2 * M_PI / 3); $page2->setFillColor(new Zend_Pdf_Color_Rgb(1, 1, 0)); $page2->drawEllipse(250, 400, 400, 350, -M_PI / 6, M_PI / 6); // Draw and fill polygon $page2->setFillColor(new Zend_Pdf_Color_Rgb(1, 0, 1)); $x = array(); $y = array(); for ($count = 0; $count < 8; $count++) { $x[] = 140 + 25 * cos(3 * M_PI_4 * $count); $y[] = 375 + 25 * sin(3 * M_PI_4 * $count); } $page2->drawPolygon($x, $y, Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE, Zend_Pdf_Page::FILL_METHOD_EVEN_ODD); // Draw line $page2->setLineWidth(0.5); $page2->drawLine(60, 375, 400, 375); $pdf->save(dirname(__FILE__) . '/_files/output.pdf'); unset($pdf); $pdf1 = Zend_Pdf::load(dirname(__FILE__) . '/_files/output.pdf'); $this->assertTrue($pdf1 instanceof Zend_Pdf); unset($pdf1); unlink(dirname(__FILE__) . '/_files/output.pdf'); }
private function drawGeneralLayout() { $recstyle = new Zend_Pdf_Style(); $recstyle->setLineWidth(0.5); $this->page->setStyle($recstyle); $this->page->drawRoundedRectangle($this->coordX(0), $this->coordY(0) - $this->mmToPts(150), $this->coordX(0) + $this->mmToPts(100), $this->coordY(0), $radius = array(15, 15, 15, 15), $fillType = Zend_Pdf_Page::SHAPE_DRAW_STROKE); //General GLS-Layout //x-achse | y-Achse | Länge | Dicke $ControlBar1 = array('x' => 1, 'y' => 2, 'length' => 98, 'thick' => 1, 'horizontal' => true); $ControlBar2 = array('x' => 1, 'y' => 15, 'length' => 98, 'thick' => 0.5, 'horizontal' => true); $ControlBar3 = array('x' => 1, 'y' => 27.5, 'length' => 98, 'thick' => 0.5, 'horizontal' => true); $ControlBar4 = array('x' => 1, 'y' => 56, 'length' => 98, 'thick' => 0.5, 'horizontal' => true); $Line1 = array('x' => 1, 'y' => 62.5, 'length' => 98, 'thick' => 0.25, 'horizontal' => true); $Line2 = array('x' => 1, 'y' => 90, 'length' => 81.5, 'thick' => 0.25, 'horizontal' => true); $Line3 = array('x' => 1, 'y' => 119, 'length' => 81.5, 'thick' => 0.25, 'horizontal' => true); $Line4 = array('x' => 1, 'y' => 134.5, 'length' => 98, 'thick' => 0.25, 'horizontal' => true); $Line5 = array('x' => 1, 'y' => 62.5, 'length' => 72, 'thick' => 0.25, 'horizontal' => false); $Line6 = array('x' => 82.5, 'y' => 62.5, 'length' => 72, 'thick' => 0.25, 'horizontal' => false); $Line7 = array('x' => 99, 'y' => 62.5, 'length' => 72, 'thick' => 0.25, 'horizontal' => false); $PrimaryCodeBorder1_1 = array('x' => 1, 'y' => 28.5, 'length' => 5, 'thick' => 1, 'horizontal' => true); $PrimaryCodeBorder1_2 = array('x' => 1.5, 'y' => 28.5, 'length' => 5, 'thick' => 1, 'horizontal' => false); $PrimaryCodeBorder2_1 = array('x' => 1, 'y' => 55, 'length' => 5, 'thick' => 1, 'horizontal' => true); $PrimaryCodeBorder2_2 = array('x' => 1.5, 'y' => 50, 'length' => 5, 'thick' => 1, 'horizontal' => false); $PrimaryCodeBorder3_1 = array('x' => 22.5, 'y' => 28.5, 'length' => 5, 'thick' => 1, 'horizontal' => true); $PrimaryCodeBorder3_2 = array('x' => 27, 'y' => 28.5, 'length' => 5, 'thick' => 1, 'horizontal' => false); $PrimaryCodeBorder4_1 = array('x' => 22.5, 'y' => 55, 'length' => 5, 'thick' => 1, 'horizontal' => true); $PrimaryCodeBorder4_2 = array('x' => 27, 'y' => 50, 'length' => 5, 'thick' => 1, 'horizontal' => false); $LayoutCollection = array($ControlBar1, $ControlBar2, $ControlBar3, $ControlBar4, $Line1, $Line2, $Line3, $Line4, $Line5, $Line6, $Line7, $PrimaryCodeBorder1_1, $PrimaryCodeBorder1_2, $PrimaryCodeBorder2_1, $PrimaryCodeBorder2_2, $PrimaryCodeBorder3_1, $PrimaryCodeBorder3_2, $PrimaryCodeBorder4_1, $PrimaryCodeBorder4_2); foreach ($LayoutCollection as $element) { // define a style $controlLayoutStyle = new Zend_Pdf_Style(); $controlLayoutStyle->setFillColor(new Zend_Pdf_Color_Rgb(0, 0, 0)); $controlLayoutStyle->setLineColor(new Zend_Pdf_Color_Rgb(0, 0, 0)); $controlLayoutStyle->setLineWidth($this->mmToPts($element['thick'])); $this->page->setStyle($controlLayoutStyle); if ($element['horizontal']) { $this->page->drawLine($this->coordX($this->mmToPts($element['x'])), $this->coordY($this->mmToPts($element['y'])), $this->coordX($this->mmToPts($element['x']) + $this->mmToPts($element['length'])), $this->coordY($this->mmToPts($element['y']))); } else { $this->page->drawLine($this->coordX($this->mmToPts($element['x'])), $this->coordY($this->mmToPts($element['y'])), $this->coordX($this->mmToPts($element['x'])), $this->coordY($this->mmToPts($element['y']) + $this->mmToPts($element['length']))); } } try { // Erstelle ein neues Grafikobjekt $imageFile = SERVER_BASE . '/images/Logo_GLS.jpg'; $stampImage = Zend_Pdf_Image::imageWithPath($imageFile); } catch (Zend_Pdf_Exception $e) { // Beispiel wie man mit Ladefehlern bei Grafiken umgeht. $stampImage = null; } if ($stampImage != null) { $this->page->drawImage($stampImage, $this->coordX(180), $this->coordY(0) - $this->mmToPts(149), $this->coordX($this->mmToPts(99)), $this->coordY($this->mmToPts(150)) + $this->mmToPts(14)); } $this->page->setStyle($this->defaultStyle); }
protected function createContent(\Zend_Pdf_Page $page) { $page->setLineWidth(2); $page->drawLine(30, 400, 810, 400); $em = EntityManager::getInstance(); $where = "settlement_total_id = " . $this->_settlement->getIdentifier(); $settlements = $em->findAll("Settlement", $where); $lines = count($settlements) + 1; $this->setFont($page); $page->drawText("Lp.", 40, 383); $page->drawText("Nazwisko i imię klienta", 90, 383, "UTF-8"); $page->drawText("Partner", 270, 383); $page->drawText("Produkt", 390, 383); $page->drawText("Transza", 520, 383); $page->drawText("Kwota", 625, 383); $page->drawText("Forma wynagrodzenia", 685, 383); $lineHeight = 25; for ($i = 0; $i <= $lines; $i++) { $page->drawLine(30, 400 - $i * $lineHeight, 810, 400 - $i * $lineHeight); if ($i > 0 && $i < $lines) { $settlement = $settlements[$i - 1]; $page->drawText($i, 45, 383 - $i * $lineHeight); $customer = $settlement->application->customer->lastname . ' ' . $settlement->application->customer->firstname; $page->drawText($customer, 80, 383 - $i * $lineHeight, "UTF-8"); $page->drawText($settlement->application->partner->name, 240, 383 - $i * $lineHeight, "UTF-8"); $page->drawText($settlement->application->product->name, 360, 383 - $i * $lineHeight, "UTF-8"); $page->drawText($settlement->parts, 480, 383 - $i * $lineHeight, 'UTF-8'); $page->drawText($settlement->amount, 630, 383 - $i * $lineHeight); $page->drawText($settlement->application->settlementType->name, 725, 383 - $i * $lineHeight); } } $bottomY = 383 - $i * $lineHeight + $lineHeight; $page->drawLine(30, 400, 30, 400 - $lines * $lineHeight); $page->drawLine(70, 400, 70, 400 - $lines * $lineHeight); $page->drawLine(230, 400, 230, 400 - $lines * $lineHeight); $page->drawLine(350, 400, 350, 400 - $lines * $lineHeight); $page->drawLine(470, 400, 470, 400 - $lines * $lineHeight); $page->drawLine(610, 400, 610, 400 - ($lines + 1) * $lineHeight); $page->drawLine(675, 400, 675, 400 - ($lines + 1) * $lineHeight); $page->drawLine(810, 400, 810, 400 - $lines * $lineHeight); $page->drawLine(470, 400 - $lines * $lineHeight, 470, 400 - ($lines + 1) * $lineHeight); $page->drawLine(470, 400 - ($lines + 1) * $lineHeight, 675, 400 - ($lines + 1) * $lineHeight); $this->setFont($page); $page->drawText("Razem", 520, 383 - $lines * $lineHeight); $page->drawText($this->_settlement->total, 630, 383 - $lines * $lineHeight); }
/** * Add Border * * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page * @throws Zend_Pdf_Exception */ public function addBorder() { $x = $this->_x(0); $y = $this->_y(0); $image = new Zend_Pdf_Resource_Image_Jpeg(Mage::getBaseDir('media') . DS . 'dhl' . DS . 'logo.jpg'); $this->_page->drawImage($image, $x + 191, $this->_y(27), $x + 287, $this->_y(1)); /* Vertical borders */ $this->_page->drawLine($x, $y, $x, $this->_y(568)); $this->_page->drawLine($x + 287.5, $y, $x + 287.5, $this->_y(568)); $this->_page->drawLine($x + 139.5, $y, $x + 139.5, $this->_y(28)); $this->_page->drawLine($x + 190.5, $y, $x + 190.5, $this->_y(28)); /* Horisontal borders */ $this->_page->drawLine($x, $y, $x + 288, $y); $this->_page->drawLine($x, $this->_y(28), $x + 288, $this->_y(28)); $this->_page->drawLine($x, $this->_y(80.5), $x + 288, $this->_y(80.5)); $this->_page->drawLine($x, $this->_y(164), $x + 288, $this->_y(164)); $this->_page->drawLine($x, $this->_y(194), $x + 288, $this->_y(194)); $this->_page->drawLine($x, $this->_y(217.5), $x + 288, $this->_y(217.5)); $this->_page->drawLine($x, $this->_y(245.5), $x + 288, $this->_y(245.5)); $this->_page->drawLine($x, $this->_y(568.5), $x + 288, $this->_y(568.5)); $this->_page->setLineWidth(0.3); $x = $this->_x(3); $y = $this->_y(83); $this->_page->drawLine($x, $y, $x + 10, $y); $this->_page->drawLine($x, $y, $x, $y - 10); $x = $this->_x(3); $y = $this->_y(161); $this->_page->drawLine($x, $y, $x + 10, $y); $this->_page->drawLine($x, $y, $x, $y + 10); $x = $this->_x(285); $y = $this->_y(83); $this->_page->drawLine($x, $y, $x - 10, $y); $this->_page->drawLine($x, $y, $x, $y - 10); $x = $this->_x(285); $y = $this->_y(161); $this->_page->drawLine($x, $y, $x - 10, $y); $this->_page->drawLine($x, $y, $x, $y + 10); return $this; }
/** * Add Border * * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page */ public function addBorder() { $x = $this->_x(0); $y = $this->_y(0); $image = new Zend_Pdf_Resource_Image_Jpeg(Mage::getDesign()->getViewFile('Mage_Usa::dhl/logo.jpg', array('theme' => false))); $this->_page->drawImage($image, $x + 191, $this->_y(27), $x + 287, $this->_y(1)); /* Vertical borders */ $this->_page->drawLine($x, $y, $x, $this->_y(568)); $this->_page->drawLine($x + 287.5, $y, $x + 287.5, $this->_y(568)); $this->_page->drawLine($x + 139.5, $y, $x + 139.5, $this->_y(28)); $this->_page->drawLine($x + 190.5, $y, $x + 190.5, $this->_y(28)); /* Horisontal borders */ $this->_page->drawLine($x, $y, $x + 288, $y); $this->_page->drawLine($x, $this->_y(28), $x + 288, $this->_y(28)); $this->_page->drawLine($x, $this->_y(80.5), $x + 288, $this->_y(80.5)); $this->_page->drawLine($x, $this->_y(164), $x + 288, $this->_y(164)); $this->_page->drawLine($x, $this->_y(194), $x + 288, $this->_y(194)); $this->_page->drawLine($x, $this->_y(217.5), $x + 288, $this->_y(217.5)); $this->_page->drawLine($x, $this->_y(245.5), $x + 288, $this->_y(245.5)); $this->_page->drawLine($x, $this->_y(568.5), $x + 288, $this->_y(568.5)); $this->_page->setLineWidth(0.3); $x = $this->_x(3); $y = $this->_y(83); $this->_page->drawLine($x, $y, $x + 10, $y); $this->_page->drawLine($x, $y, $x, $y - 10); $x = $this->_x(3); $y = $this->_y(161); $this->_page->drawLine($x, $y, $x + 10, $y); $this->_page->drawLine($x, $y, $x, $y + 10); $x = $this->_x(285); $y = $this->_y(83); $this->_page->drawLine($x, $y, $x - 10, $y); $this->_page->drawLine($x, $y, $x, $y - 10); $x = $this->_x(285); $y = $this->_y(161); $this->_page->drawLine($x, $y, $x - 10, $y); $this->_page->drawLine($x, $y, $x, $y + 10); return $this; }
// Draw ellipse $page2->setFillColor(new Zend_Pdf_Color_Rgb(1, 0, 0)); $page2->drawEllipse(250, 400, 400, 350); $page2->setFillColor(new Zend_Pdf_Color_Cmyk(1, 0, 0, 0)); $page2->drawEllipse(250, 400, 400, 350, M_PI/6, 2*M_PI/3); $page2->setFillColor(new Zend_Pdf_Color_Rgb(1, 1, 0)); $page2->drawEllipse(250, 400, 400, 350, -M_PI/6, M_PI/6); // Draw and fill polygon $page2->setFillColor(new Zend_Pdf_Color_Rgb(1, 0, 1)); $x = array(); $y = array(); for ($count = 0; $count < 8; $count++) { $x[] = 140 + 25*cos(3*M_PI_4*$count); $y[] = 375 + 25*sin(3*M_PI_4*$count); } $page2->drawPolygon($x, $y, Zend_Pdf_Page::SHAPE_DRAW_FILL_AND_STROKE, Zend_Pdf_Page::FILL_METHOD_EVEN_ODD); // Draw line $page2->setLineWidth(0.5); $page2->drawLine(60, 375, 400, 375); //------------------------------------------------------------------------------------ if (isset($argv[2])) { $pdf->save($argv[2]); } else { $pdf->save($argv[1], true /* update */); }
function pdfdisplayAction() { $convertdate = new App_Model_dateConvertor(); // echo '<pre>'; print_r($this->_request->getParam('accNum')); $this->view->details = $this->view->loanModel->searchaccounts($this->_request->getParam('accNum')); //echo '<pre>'; print_r($this->view->details); $this->view->tran = $this->view->loanModel->loanInstalments($this->_request->getParam('accNum')); $this->view->paid = $this->view->loanModel->paid($this->_request->getParam('accNum')); $this->view->unpaid = $this->view->loanModel->unpaid($this->_request->getParam('accNum')); // $loansearch = new Loandetailsg_Form_Search(); // $loantransactions = new Loandisbursmentg_Model_loan(); $app = $this->view->baseUrl(); $word = explode('/', $app); $projname = $word[1]; $pdf = new Zend_Pdf(); $page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4); $pdf->pages[] = $page; // Image $image_name = "/var/www/" . $projname . "/public/images/logo.jpg"; $image = Zend_Pdf_Image::imageWithPath($image_name); $page->drawImage($image, 30, 770, 130, 820); $page->setLineWidth(1)->drawLine(25, 25, 570, 25); //bottom horizontal $page->setLineWidth(1)->drawLine(25, 25, 25, 820); //left vertical $page->setLineWidth(1)->drawLine(570, 25, 570, 820); //right vertical $page->setLineWidth(1)->drawLine(570, 820, 25, 820); //top horizontal $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 8); $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA); $page->drawText('( LOAN LEDGER )', 237, 780); $text = array("Member details"); $x0 = 50; $x3 = 310; $x1 = 150; $x2 = 220; $page->drawLine(50, 740, 290, 740); $page->drawLine(50, 720, 290, 720); $page->drawText($text[0], 90, 727); $y1 = 700; foreach ($this->view->details as $details) { $page->drawText('Name : ' . $details->name, $x0, $y1); $y1 = $y1 - 20; $page->drawText('Branch : ' . $details->officename, $x0, $y1); $y1 = $y1 - 20; $page->drawText('Code : ' . $details->code, $x0, $y1); $y1 = $y1 - 20; $page->drawText('Account code : ' . $details->number, $x0, $y1); $text1 = array("Loan details"); $y1 = $y1 - 25; $page->drawLine(50, $y1, 290, $y1); $y1 = $y1 - 20; $page->drawLine(50, $y1, 290, $y1); $y1 = $y1 + 7; $page->drawText($text1[0], 90, $y1); $y1 = $y1 - 25; $page->drawText('Loan name : ' . $details->loanname, $x0, $y1); $y1 = $y1 - 20; $page->drawText('Loan amount Rs : ' . $details->amount, $x0, $y1); $y1 = $y1 - 20; $page->drawText('Interest rate % : ' . $details->interest, $x0, $y1); $y1 = $y1 - 20; $page->drawText('Installments : ' . $details->installments, $x0, $y1); $y1 = $y1 - 20; $page->drawText('Sanctioned date : ' . $details->sanctioned, $x0, $y1); $y1 = $y1 - 20; } $y1 = 740; $text2 = array("Installment status No Amount"); $page->drawLine(310, $y1, 550, $y1); $y1 = $y1 - 20; $page->drawLine(310, $y1, 550, $y1); $y1 = $y1 + 7; $page->drawText($text2[0], $x3, $y1); foreach ($this->view->paid as $paid) { $y1 = $y1 - 25; $page->drawText('Paid' . $paid->paidAmt, 320, $y1); $page->drawText($paid->paidCount, 390, $y1); } foreach ($this->view->unpaid as $unpaid) { $y1 = $y1 - 20; $page->drawText('Due', 320, $y1); $page->drawText($unpaid->unpaidCount, 390, $y1); $page->drawText($unpaid->unpaidAmt, 430, $y1); } $y1 = 480; $text3 = array("GL.LF no Transaction date Creidt Debit Payment mode Transacted by "); $page->drawLine(50, $y1, 550, $y1); $y1 = $y1 - 20; $page->drawLine(50, $y1, 550, $y1); $y1 = $y1 + 7; $page->drawText($text3[0], $x0, $y1); foreach ($this->view->tran as $transaction) { $y1 = $y1 - 20; $page->drawText($transaction->id, 60, $y1); $page->drawText($transaction->date, 120, $y1); $page->drawText($transaction->cr, 160, $y1); $page->drawText($transaction->dt, 250, $y1); $page->drawText($transaction->mode, 330, $y1); $page->drawText($transaction->name, 420, $y1); $y1 = $y1 - 5; $page->drawLine(50, $y1, 550, $y1); } $pdf->pages[] = $page; $pdfData = $pdf->render(); $pdf->save('/var/www/' . $projname . '/reports/loanledger.pdf'); $path = '/var/www/' . $projname . '/reports/loanledger.pdf'; chmod($path, 0777); }
/** * Render section header * * @param Zend_Pdf_Page $page * @param int $yCoordinate * @param array $sectionValues * @param int $layoutType * * @return Zend_Pdf_Page */ protected function _renderSectionBody(&$page, &$yCoordinate, array $sectionValues, $layoutType = self::ONE_COLUMN_LAYOUT) { $preparedSectionValues = $this->_prepareSectionValues($sectionValues, $layoutType); $lineCount = max(count($preparedSectionValues['left']), count($preparedSectionValues['right'])); if ($lineCount > 0) { $sectionStartY = $yCoordinate + 7; for ($i = 0; $i < $lineCount; $i++) { if ($yCoordinate < 45) { $yCoordinate -= 15; $page->drawLine(25, $sectionStartY, 570, $sectionStartY); // top $page->drawLine(25, $sectionStartY, 25, $yCoordinate); // left $page->drawLine(25, $yCoordinate, 570, $yCoordinate); // bottom $page->drawLine(570, $yCoordinate, 570, $sectionStartY); // right $page = $this->newPage(); $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5)); $page->setLineWidth(0.5); $this->_setFontRegular($page, 10); $sectionStartY = 800; $this->y -= 10; } if (isset($preparedSectionValues['left'][$i])) { $this->_drawPreparedValue($page, $yCoordinate, 35, $preparedSectionValues['left'][$i]); } if (isset($preparedSectionValues['right'][$i])) { $this->_drawPreparedValue($page, $yCoordinate, 285, $preparedSectionValues['right'][$i]); } $yCoordinate -= 10; } $yCoordinate -= 15; $page->drawLine(25, $sectionStartY, 570, $sectionStartY); // top $page->drawLine(25, $sectionStartY, 25, $yCoordinate); // left $page->drawLine(25, $yCoordinate, 570, $yCoordinate); // bottom $page->drawLine(570, $yCoordinate, 570, $sectionStartY); // right $yCoordinate -= 7; if ($yCoordinate < 45) { $page = $this->newPage(); $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5)); $page->setLineWidth(0.5); $this->_setFontRegular($page, 10); } } return $page; }
/** * Insert footer * * @param Zend_Pdf_Page $page Current page object of Zend_Pdf * * @return void */ protected function _insertFooter(&$page) { $page->setLineColor($this->colors['black']); $page->setLineWidth(0.5); $page->drawLine($this->margin['left'] - 20, $this->y - 5, $this->margin['right'] + 30, $this->y - 5); $this->Ln(15); $this->_insertFooterAddress($page); $fields = array('telephone' => Mage::helper('firegento_pdf')->__('Telephone:'), 'fax' => Mage::helper('firegento_pdf')->__('Fax:'), 'email' => Mage::helper('firegento_pdf')->__('E-Mail:'), 'web' => Mage::helper('firegento_pdf')->__('Web:')); $this->_insertFooterBlock($page, $fields, 70, 40, 140); $fields = array('bank_name' => Mage::helper('firegento_pdf')->__('Bank name:'), 'bank_account' => Mage::helper('firegento_pdf')->__('Account:'), 'bank_code_number' => Mage::helper('firegento_pdf')->__('Bank number:'), 'bank_account_owner' => Mage::helper('firegento_pdf')->__('Account owner:'), 'swift' => Mage::helper('firegento_pdf')->__('SWIFT:'), 'iban' => Mage::helper('firegento_pdf')->__('IBAN:')); $this->_insertFooterBlock($page, $fields, 215, 50, 150); $fields = array('tax_number' => Mage::helper('firegento_pdf')->__('Tax number:'), 'vat_id' => Mage::helper('firegento_pdf')->__('VAT-ID:'), 'register_number' => Mage::helper('firegento_pdf')->__('Register number:'), 'ceo' => Mage::helper('firegento_pdf')->__('CEO:')); $this->_insertFooterBlock($page, $fields, 355, 60, $this->margin['right'] - 365 - 10); }