This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Developer » ezcDocument vs Zend_Pdf
expandshrink

ezcDocument vs Zend_Pdf

ezcDocument vs Zend_Pdf

Saturday 14 November 2009 9:27:44 pm - 1 reply

Zend 1 - 0 eZComponent

Today i build a module that contains a view that generate a pdf file.

On previous installations we use a custom pdf lib (non standard, got some issues, not OO etc..), as ez4.1 comes bundle with ezc, i gived it a try. but unfortunatly got an issue with Haru driver.

the doc shows the following:

The Haru driver is pretty fast, but currently has issues with some special characters. It is the default driver, but can be explicitly used by setting the driver option on the PDF class, like:

$pdf = new <a href="http://www.ezcomponents.org/docs/api/trunk/Document/ezcDocumentPdf.html">ezcDocumentPdf</a>();
$pdf->options->driver = new <a href="http://www.ezcomponents.org/docs/api/trunk/Document/ezcDocumentPdfHaruDriver.html">ezcDocumentPdfHaruDriver</a>();

pretty nice. Unfortunatly the constructor instanciate a HaruDriver, so you cannot switch to another driver if you don't have haru working on your env ;(

So i switch to Zend_Pdf component. Works like a charms

Step to install:

  1. Download ZendFramework
  2. Create folder $EZ_HOME/lib/zf
  3. Unzip your tarball
  4. copy Zend/Pdf/* and Zend/Pdf.php to $EZ_HOME/lib/zf
  5. add a line to $EZ_HOME/autoload.php to add ./lib/zf to the php include path
  6. generate autoloads php bin/php/ezpgenerateautoload.php

Works like a charm (without any fancy Haru lib)

The Haru driver is pretty fast, but currently has issues with some special characters. It is the default driver, but can be explicitly used by setting the driver option on the PDF class, like:

$pdf = new <a href="http://www.ezcomponents.org/docs/api/trunk/Document/ezcDocumentPdf.html" mce_href="http://www.ezcomponents.org/docs/api/trunk/Document/ezcDocumentPdf.html">ezcDocumentPdf</a>();
$pdf->options->driver = new <a href="http://www.ezcomponents.org/docs/api/trunk/Document/ezcDocumentPdfHaruDriver.html" mce_href="http://www.ezcomponents.org/docs/api/trunk/Document/ezcDocumentPdfHaruDriver.html">ezcDocumentPdfHaruDriver</a>();

Saturday 14 November 2009 11:49:31 pm

Unfortunatly the constructor instanciate a HaruDriver, so you cannot switch to another driver if you don't have haru working on your env ;(

1 - did you file this as a bug?

2 - did you try a quick hack to the constructor to see if using the tcpdf driver was ok?

3 - according to http://ezcomponents.org/docs/api/...t/ezcDocument.html#method__construct, you can pass an options object to the constructor. Maybe this is the way to avoid having the haru stuff loaded?

Modified on Saturday 14 November 2009 11:53:10 pm by Gaetano Giunta

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from