Details
Description
I've just upgraded to ZF 1.9.0 and I have a problem running my unit tests. Currently my invoices are generated by an external script which uses htmldoc, and then I've incapsulated the generated pdf file into a Zend_Pdf object with this code:
$temppdf = <external_script> // this is a string containig the pdf filename with full path $pdf = Zend_Pdf::load($temppdf); //unlink($temppdf); return $pdf;
Until ZF 1.9 everything works, now after the upgrade I receive this exception:
2) testCreatePdfInvoice(Model_Default_InvoiceTest)
Zend_Pdf_Exception: Action dictionary must contain S entry
/Users/fabionapoleoni/Downloads/ZendFramework-1.9.0/library/Zend/Pdf/Action.php:128
/Users/fabionapoleoni/Downloads/ZendFramework-1.9.0/library/Zend/Pdf/Target.php:47
/Users/fabionapoleoni/Downloads/ZendFramework-1.9.0/library/Zend/Pdf.php:530
/Users/fabionapoleoni/Downloads/ZendFramework-1.9.0/library/Zend/Pdf.php:353
/Users/fabionapoleoni/Downloads/ZendFramework-1.9.0/library/Zend/Pdf.php:292
/Users/fabionapoleoni/Documents/workspaces/php/ZenitSpot Trunk/application/modules/default/models/Invoice.php:42
/Users/fabionapoleoni/Documents/workspaces/php/ZenitSpot Trunk/test/Model/Default/InvoiceTest.php:62
I tried to comment the unlink instruction and open the pdf file with OS X Preview and with Acrobat reader, and the file is intact. I also isolated the failing row in another testcase in this way and (clearly) the test fails.
/**
* Load a pdf generated by htmldoc
*/
public function testLoadPdf() {
Zend_Pdf::load(dirname(__FILE__) . '/../Data/invoice.pdf');
}
I don't know if this is a htmldoc problem or Zend_Pdf, but I can read pdf's built with htmldoc on every operating system/pdf reader.
I put on a webserver the generated pdf the url is http://rapidshare.com/files/263230771/invoice.pdf.html
Fixed.