
89,- €*
Advanced Invoice Layout
- Customizable templates for PDF invoices/shipments/creditmemos
- Display of crosssell product on the PDF invoice
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 namegetHtmlContents()
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 us if you have any questions.