php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34929 Apache crash when using a pdf function
Submitted: 2005-10-20 12:11 UTC Modified: 2005-10-28 01:00 UTC
From: guillaume dot delbar at worldonline dot fr Assigned:
Status: No Feedback Package: PDF related
PHP Version: 4.4.0 OS: Win 2k/Xp
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: guillaume dot delbar at worldonline dot fr
New email:
PHP Version: OS:

 

 [2005-10-20 12:11 UTC] 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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-20 20:33 UTC] tony2001@php.net
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
 [2005-10-28 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC