ID: 34929 Updated by: [EMAIL PROTECTED] Reported By: guillaume dot delbar at worldonline dot fr -Status: Open +Status: Feedback Bug Type: PDF related Operating System: Win 2k/Xp PHP Version: 4.4.0 New Comment:
I can see only the error below: Fatal error: PDFlib error: [2100] PDF_setfont: Function must not be called in 'document' scope in /www/index.php on line 12 Previous Comments: ------------------------------------------------------------------------ [2005-10-20 12:11:55] guillaume dot delbar at worldonline dot fr Description: ------------ Hello, I'm trying to generate a PDF file who contains unicode characters. If i do this : $fontdir = "C:/my/font/dir"; pdf_set_parameter($pdf, "FontOutline", "ArialUnicode=$fontdir/ARIALUNI.TTF"); $font = pdf_findfont($pdf, "ArialUnicode", "winansi", 0); My chinese characters are not correctly showed (è¿oe离ç«å¤) So i tried this : $fontdir = "C:/my/font/dir"; pdf_set_parameter($pdf, "textformat", "utf8"); pdf_set_parameter($pdf, "FontOutline", "ArialUnicode=$fontdir/ARIALUNI.TTF"); $font = pdf_findfont($pdf, "ArialUnicode", "winansi", 0); And then Apache (1.3.33) crashed whith the message "Apache.exe has generated errors and will be closed by Windows" I think there is a problem with `pdf_set_parameter($pdf, "textformat", "utf8");` But PDFlib or PHP bug ? I don't know ! Regards Reproduce code: --------------- $pdf = pdf_new(); pdf_open_file($pdf); $fontdir = "C:/my/font/dir"; pdf_set_parameter($pdf, "textformat", "utf8"); pdf_set_parameter($pdf, "FontOutline", "ArialUnicode=$fontdir/ARIALUNI.TTF"); $font = pdf_findfont($pdf, "ArialUnicode", "winansi", 0); pdf_setfont($pdf, $font, 24); pdf_show_xy($pdf, "Chinese chars provided from a DB", 50, 750); Expected result: ---------------- Correct PDF file ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34929&edit=1