Yes, I was aware of those. I don't use them because I implemented my own xml based solutions that has support for tables, page breaking, columns, full rich text support, etc. The basic support in those two engines was never enough. All I really need are the primitives to measure, style and draw text, and of course primitive line and shape drawing operations. I have an abstraction layer that lets me swap back and forth between R&OS and FPDF. My XML parser / DOM style rendering library handles the rest. So I don't think it would be too hard to use Zend_Pdf instead.

I have also used the extensions listed on the FPDF homepage to add Chinese and other multi-byte languages to PDFs. It is fairly straightforward. The bigger issue is that all of these examples involve using local encodings, not unicode. Once you start wanting to throw unicode in there it gets a little tricky.

The PDF renderer needs to map the text it is trying to render to an available font. Unfortunately none of the standard PDF fonts are unicode fonts. So if you want to be able to actually put unicode text in and have it understood then you have to (if I am reading the spec correctly) embed the unicode font right into the PDF . Licensing issues aside entire unicode fonts are about 10-20 Mb. Most of the PDFs I generate are under 50 Kb so that's certainly not going to work. So what I am left with is to determine the language of each block of text and convert it to a local encoding that the PDF spec will happily accept. That seems a little tricky.

Say you have a small segment of Japanese with only a few Kanji characters. How do I distinguish that from a few characters of Traditional Chinese? Lets say I figure that part out but then they have say Korean mixed into the same text with Japanese. I have to split out the Korean from the Japanese and draw them separately each time converting to a local encoding and indicating the correct font to use.

Anyway that is the problem as I see it. Once I get this figured out I would happily contribute any or all of it to Zend_Pdf if the author wants it. I have this hope that someone working on the Zend_Pdf is going to say that I've read the spec all wrong and that I can somehow add unicode text directly to the pdf and have the PDF reader map it all to a unicode font if present or into the various non-unicode local fonts if if it's not. And of course if whoever is working on the UTF-8 support for Zend_Pdf figures it all out and implements it I'll be more than happy to just switch my rendering engine to just use Zend_Pdf for primitives and get the unicode support for free.

Hopefully this will spark some discussion about the implementation of such a feature. Also if this is not the correct list for this sort of discussion could someone please direct me to the correct place.

Thanks,

Rick


On Nov 7, 2007, at 3:47 PM, Bryce Lohr wrote:

Just FYI (in case you're not already aware), R&OS and FPDF both have several features (particularly with text formatting, such as automatic line and page breaks, automatic text positioning) that are not currently implemented in Zend_Pdf. You will probably want to keep that in mind, since you're most likely using those features right now.

HTH,
Bryce Lohr


Rick Gigger wrote:
I am currently using both R&OS PDF and FPDF. I'm going to need to add support for both Japanese and Chinese soon. I am planning on either updating one or both of those those two pdf engines to handle unicode or switching over to Zend_Pdf entirely and adding in the support there for that. I know that I can just extend FPDF to work if I need to but I don't know if I could just extend Zend_Pdf or if I would need to actually patch the code to Zend_Pdf itself. Of course if I could discuss my implementation with a Zend_Pdf developer and gain confidence that my changes could be incorporated into Zend_Pdf that would be optimal.

Also if Zend_Pdf completes Full UTF-8 support before I do that would be even better. Just looking for ways to share the load, if anyone here is interested in discussing this with me please drop me a line, on or off the list.

Thanks,

Rick



On Nov 1, 2007, at 11:23 AM, Alexander Veremyev wrote:

Hi all,

I've tried to collect Zend_Pdf functionality requests and bring them into one list. It's placed in FW wiki now (http://framework.zend.com/wiki/x/45Y ).

I ordered it by a priority I think items should have.

May be something is missing in this list? Or priority should be changed?
Thoughts, comments, suggestions are welcome!


With best regards,
 Alexander Veremyev.

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.14/1100 - Release Date: 30.10.2007 18:26



Reply via email to