![Advanced Invoice Layout Extension for Magento](https://www.vianetz.com/skin/frontend/vianetz/default/images/products/placeholder.png?width=130)
89 €*
Advanced Invoice Layout Extension for Magento
- Anpassbare Layouts für PDF-Rechnungen/-Lieferscheine/-Gutschriften
- Anzeige von Crosssell-Produkten auf der Rechnung
Magento developers can use my Advanced Invoice Layout Extension to either customize the default look'n'feel of the Magento PDF invoices, shipments and creditmemos or alternatively to implement their own PDF printing extension based on the ready-to-use vianetz PDF API.
Class Vianetz_Pdf_Model_Pdf
:
addDocument(Vianetz_Pdf_Model_Document_Interface)
Add a new document to the PDF instancegetContents()
Return the PDF file contentssaveToFile(string)
Generate and save the current PDF contents to specified file nameThe magic lies in the Vianetz_Pdf_Model_Document_Interface
which asks you to implement the following method:
getHtmlContents()
Return the HTML contents that should be converted into PDF<?php
class Your_Document implements Vianetz_Pdf_Model_Document_Interface {
/**
* This fetches the product detail page content for product id 1.
* You can return any kind of HTML content here.
*/
public function getHtmlContents()
{
$block = Mage::getBlockSingleton('catalog/product_view')
->setProductId(1);
$block->setTemplate('catalog/product/view.phtml');
return $block->toHtml();
}
}
// Create a new pdf instance.
$pdf = new Vianetz_Pdf_Model_Pdf();
// Add our document class. You can add as many documents as you like
// as they will all be merged into one PDF file.
$pdf->addDocument(new Your_Document());
// Save the resulting PDF to file test.pdf - That's it :-)
$pdf->saveToFile('test.pdf');
Please get in touch with me if you have any questions.