Can anybody tell me where I can change the title of the invoice pdf. At the moment it states invoice(date and time). I want to change it to Invoice(invoicenumber)I work with magento 1.9.1.

2 Answers 2


Vinothavn, thnx for your answer. I looked into the coding and tried it, but unfortulnately it didnt work. But I altered some other code in the same file and that did work. I changed this:

                '.pdf', $pdf->render(), 'application/pdf');

Into this:

$this->_prepareDownloadResponse('Factuur_'. $invoice->getIncrementId().
                '.pdf', $pdf->render(), 'application/pdf')

And now the pdf exports with the invoicenumber.


The file which has the invoice tile is in below path


   public function pdfinvoicesAction(){
    $invoicesIds = $this->getRequest()->getPost('invoice_ids');
    if (!empty($invoicesIds)) {
        $invoices = Mage::getResourceModel('sales/order_invoice_collection')
            ->addAttributeToFilter('entity_id', array('in' => $invoicesIds))
        if (!isset($pdf)){
            $pdf = Mage::getModel('sales/order_pdf_invoice')->getPdf($invoices);
        } else {
            $pages = Mage::getModel('sales/order_pdf_invoice')->getPdf($invoices);
            $pdf->pages = array_merge ($pdf->pages, $pages->pages);

        return $this->_prepareDownloadResponse('invoice'.Mage::getSingleton('core/date')->date('Y-m-d_H-i-s').
            '.pdf', $pdf->render(), 'application/pdf');

You can change

  return $this->_prepareDownloadResponse('invoice'.Mage::getSingleton('core/date')->date('Y-m-d_H-i-s').
            '.pdf', $pdf->render(), 'application/pdf');


return $this->_prepareDownloadResponse('invoice'.$invoicesIds.
            '.pdf', $pdf->render(), 'application/pdf');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.