Showing posts with label DrawFooter in pdf invoice magento. Show all posts
Showing posts with label DrawFooter in pdf invoice magento. Show all posts

Tuesday 9 December 2014

Add footer in pdf invoice magento


Add footer in pdf invoice magento

Here i will explain you how to draw footer in pdf invoice. First of open the Invoice.php file.

app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php

Copy below function and paste it in invoice.php at last.

protected function _drawFooter(Zend_Pdf_Page $page)
    {
        /* Add table foot */
        $this->_setFontRegular($page, 8);
        $this->y -= 10;
        $page->setFillColor(new Zend_Pdf_Color_RGB(0, 0, 0));
$page->drawLine(25, $this->y-20, 570, $this->y-20);

        $page->drawText(Mage::helper('sales')->__('Amount Chargeable including sales Tax/Vat Applied as per Ankleshwar Govt.'), 35, $this->y-50, 'UTF-8');
$page->drawText(Mage::helper('sales')->__('Company VAT/TIN :'), 35, $this->y-65, 'UTF-8');
$page->drawText(Mage::helper('sales')->__('XXXXXXXX'), 175, $this->y-65, 'UTF-8');
$page->drawText(Mage::helper('sales')->__('Company PAN :'), 35, $this->y-80, 'UTF-8');
$page->drawText(Mage::helper('sales')->__('XXXXXXXXX'), 175, $this->y-80, 'UTF-8');
$page->drawText(Mage::helper('sales')->__('Registered Address :'), 35, $this->y-95, 'UTF-8');
$page->drawText(Mage::helper('sales')->__('2/1970, Rudarpura, malifalia, Surat - 395002(INDIA)'), 175, $this->y-95, 'UTF-8');

$page->drawText(Mage::helper('sales')->__('This is a system generated receipt.Signatures are not required'), 340, $this->y-110, 'UTF-8');

$page->drawLine(25, $this->y-130, 570, $this->y-130);

    }

Now put this line in getPdf() function after totals block

$this->_drawFooter($page);

Now check your PDF Invoice and Enjoy Chandresh rana's Coding....