I agree, but if he needs to work with existing code it's better to go around it, instead of hacking ZF classes. Then he can safely upgrade to a newer version that will hopefully contain features he is after. I managed to do that without any hacks or code duplication and I can easily replace it with better implementation once those feature are added to Zend_Pdf. This is just my suggestion.
Karol Micah Gersten wrote: > > I would consider it a problem if you cannot extend the zend framework. > > Thank you, > Micah Gersten > onShore Networks > Internal Developer > http://www.onshore.com > > > > Karol Grecki wrote: >> Martijn >> >> I encountered the same problem over a year ago and I managed to build my >> own >> paragraph and table functionality without extending any of the Zend >> classes. >> They work by accepting zend page object as an argument so the interface >> is a >> bit different then regular methods but they work fine. >> >> Karol >> >> >> Martijn Korse wrote: >> >>> I've used fpdf a few times (some time ago) and last week took a look at >>> Zend_Pdf >>> Let met start by saying i'm really happy with it, as it's so much >>> clearer! >>> >>> However, i got disappointed quite quickly when it appeared that Zend_Pdf >>> doesn't do text wrapping of large amounts of text. So, first i did a >>> search with google to see if other people had tackled this issue. I >>> found >>> a class called Zend_Cell_Pdf, but unfortunately, that didn't work with >>> my >>> 1.5.2 installation. and every time i fixed one bug, i bumped into >>> another. >>> Also, i saw that even if i got it working it wouldn't support aligning >>> the >>> text with 'justify' - something i also need >>> >>> So, since it didn't seem to hard to program this functionality my self, >>> i >>> decided to do just that. >>> One hour later, i had class that could create a text-block and even >>> align >>> it (left, right, center & justify). But then, the problems with Zend_Pdf >>> started. >>> >>> I wrote a class that could do all the calculations and store the >>> information about all the lines and spacing information. >>> To keep things clean, i decided to overload the drawText function, by >>> extending the Zend_Pdf_Page class and writing my own function. >>> But since the $page object is created form the Zend_Pdf class i had to >>> extend that class too, in order to let it instantiate my new page class. >>> The problem is: both classes are filled with private variables that make >>> extending them impossible. So, i'm left with two options: >>> 1) modifying the Zend Framework classes so they can hadle my new >>> functionality. I don't want this, because then i can never upgrade >>> anymore >>> 2) copying a lot code to my own classes to be able to write the output. >>> this i obviously also don't want. >>> >>> I'm posting this here, to get some feedback. Maybe i'm overlooking some >>> getter/setter functions? Maybe someone can explain to me if this was >>> done >>> intentionaly and why? >>> >>> i don't mind sharing my class btw. is that something i should post here >>> on >>> the mailinglist or is there a better place for that? >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/Zend_Pdf-..-problems-extending-the-class-tp18555196p18557466.html Sent from the Zend Framework mailing list archive at Nabble.com.
