|
|||
|
Hi,
I have problems with write UTF-8 strings in russian language, for ex. "Русский язык") to PDF file - some chars are not processed. Notice: iconv() [function.iconv]: Detected an illegal character in input string in ...library/Zend/Pdf/Resource/Font.php on line 522 A similar problem has been here: PDF file with UTF-8 string Therefore, ask again: Please, how can I generate PDF file from UTF-8 strings with national characters? thanks. Last edited by tim4dev : 10-23-2007 at 01:41 PM. |
|
|||
|
Hey, I've got a smiliar Problem!
I want to export chinese words, but none of them are beeing shown in the pdf-document. The reason is, that the included font-types don't support those special chars. Is this a bug or where can I get FREE and WORKING font-types? The best would be, if they'd work for all languages, but "ARIAL UNICODE MS" for example makes ZEND FRAMEWORK throwing an Exception... Any Ideas??? ZF-Version is 1.5 RC1 The Exception-warning Fatal error: Uncaught exception 'Zend_Pdf_Exception' with message 'Attempt to move beyond end of data source' in /daten/webserver/php-lib/Zend/Pdf/FileParserDataSource.php:183 Stack trace: #0 /daten/webserver/php-lib/Zend/Pdf/FileParserDataSource/File.php(176): Zend_Pdf_FileParserDataSource->moveToOffset(24131012) #1 /daten/webserver/php-lib/Zend/Pdf/FileParserDataSource.php(202): Zend_Pdf_FileParserDataSource_File->moveToOffset(24131012) #2 /daten/webserver/php-lib/Zend/Pdf/FileParser.php(209): Zend_Pdf_FileParserDataSource->skipBytes(16) #3 /daten/webserver/php-lib/Zend/Pdf/FileParser/Font/OpenType.php(393): Zend_Pdf_FileParser->skipBytes(16) #4 /daten/webserver/php-lib/Zend/Pdf/FileParser/Font/OpenType.php(120): Zend_Pdf_FileParser_Font_OpenType->_parsePostTable() #5 /daten/webserver/php-lib/Zend/Pdf/FileParser/Font/OpenType/TrueType.php(80): Zend_Pdf_FileParser_Font_OpenType->parse() #6 /daten/webserver/php-lib/Zend/Pdf/Font.php(747): Zend_Pdf_FileParser_Font_OpenType_TrueType->parse() #7 /daten/webserver/php-lib/Zend in /daten/webserver/php-lib/Zend/Pdf/FileParserDataSource.php on line 183 : Last edited by Anybody : 03-07-2008 at 02:29 PM. Reason: Exception-Warning added |
|
|||
|
Quote:
. I'm in an utf8 environment so a slight adjustment works for me: code): Code:
$text = "æøå ÆØÅ"; $page->drawText($text,100,200,"UTF-8") Quote:
Then you create a font like this: (use the fontWithPath() method). This worked for me. Code:
$my_font = Zend_Pdf_Font::fontWithPath('www/fonts/my-special-font.ttf');
Last edited by fsando : 03-24-2008 at 12:35 PM. Reason: Found errors |
|
||||
|
Quote:
If you haven't seen this, check out the Zend_PDF part of the docs where it talks about fonts: Zend Framework: Documentation You can use any font you want, provided you stay with in the supported font types (TTF Type 1 is the most universal). If you know of a font that falls within the guidelines on the docs, and that you have available to you - just copy it to your project, and provide the full path to it when you call Zend_Pdf_Font::fontWithPath() HTH
__________________
- xentek |
|
|||
|
Quote:
I've got a question about chinese word too! When I use Zend_Pdf_Font::fontWithPath('www/fonts/my-special-font.ttf') to embed chinese font into Pdf-document, it can normally shown , but the File-size become very big. Any way can I subset embed or don't embed , but let my char normally output ? |
|
|||
|
I have the same problem with chinese characters... The font weights 15 meg so I can not embed it in the document.
I posted question about that in another thread. I am really not sure there is a solution so I considered either create a TTF myself containing only the characters I use. Or render the typo in images and embed the images in the PDF. If anybody has a solution it would save my life ![]() |
![]() |
| Thread Tools | |
| Display Modes | |
|
|