Magento's wiki has a few articles on the subject of Magento's PDF generation, which is not very efficient in its default version : one of the main critics I've seen is the size of the generated PDF, which can fly to more than 1MB, where a simple font replacement can bring the weight to less than a few KBs ! The subject of the article below is to illustrate how to display images on each line of the generated invoice and shipping PDF.
The product line display occurs in specific PHP classes within the app/code/core/Mage/sales/Model/order/pdf folder
there is one folder for shipment, one for invoice, and one for credit. The product display occurs in the DEfault file where the Mage_Sales_Model_Order_Pdf_Items_Abstract is defined. What I did was simply instanciate a product object using the id from order / items, and get the image file using the following code in the draw function :
//<display image>
$id = Mage::getModel('catalog/product')->getIdBySku($this->getSku($item));
$product= Mage::getModel('catalog/product')->load($id);
$imageUrl = $product->getSmallImageUrl();
$imageFile= str_replace(Mage::getBaseUrl('media'),"media/",$imageUrl);
// $page->drawText($imageFile , 65, $pdf->y-$shift{1}, 'UTF-8');
$imageWidth = 100; $imageHeight = 50;
$image = Zend_Pdf_Image::imageWithPath($imageFile,$imageWidth,$imageHeight);
$y=$pdf->y - $imageHeight /3;
$page->drawImage($image, 35,$y, 35+ $imageWidth / 2, $y + $imageHeight/2);
//</display image>