Re: PDF document with Japanese characters
Claire Hector <[email protected]>
| Newsgroups | gmane.comp.php.internationalization |
|---|---|
| Organization | Matsushita Electric Works, Ltd. |
| Message-ID | <[email protected]> |
Hello Durgaprasada, I'm not going to pretend I can answer your question but thought I might give you something to think about if you haven't already. Firstly, though what version of php are you using? In terms of the font.... I was of the understaning that the encoding for pdf_set_font() took one of the following parameters [ 0 = builtin, 1 = pdfdoc, 2 = macroman, 3 = macexpert, 4 = winansi ] however for pdf_findfont (php > 4.05) the encoing could be one of "builtin", "macroman", "winansi", "host", or a user-defined encoding name, or the name of a CMap. In your code I see the you are using pdf_set_font with EUC-H. The notes which you have probably seen on pdflib say when using fonts to " pay attention to the UPR section of the PDFLib manual." I don't have time this morning to look over that section but if you haven't already maybe do that again. Good Luck Claire ------------------------------------------------ Claire Hector Matsushita Electric Works Ltd. Quality Management System Group Corporate Quality Management ------------------------------------------------ Durgaprasada Kalluraya wrote: > Hi, > > I am trying to create a PDF document containing the japanese charcters. But > I am having problem with that. Some japanese charcters are missing in the > PDF generated. > > The characters which does not get displayed are ?,??etc. > > Is this encoding problem or font problem? > > I had the same problem while creating a image which had these charcters. > > The settings which I am going to use finally are, > > 1) The text content, which needs to be put in PDF will come from the > database. > > 2) php.ini file settings are, > > gd > > GD Support => enabled > GD Version => 2.0 or higher > FreeType Support => enabled > FreeType Linkage => with TTF library > JPG Support => enabled > PNG Support => enabled > WBMP Support => enabled > > mbstring > > Multibyte Support => enabled > Japanese support => enabled > > Directive => Local Value => Master Value > mbstring.detect_order => no value => no value > mbstring.encoding_translation => Off => Off > mbstring.func_overload => 0 => 0 > mbstring.http_input => pass => pass > mbstring.http_output => pass => pass > mbstring.internal_encoding => none => none > mbstring.language => neutral => neutral > mbstring.substitute_character => no value => no value > > pdf > > PDF Support => enabled > PDFlib GmbH Version => 4.0.3 > Revision => $Revision: 1.112.2.2 $ > > The PHP code is as follows, > > <?php > > $fp = fopen( "test.pdf", "w"); > $pdf = PDF_open($fp); > > PDF_begin_page($pdf, 400, 200); > > pdf_set_text_rendering($pdf, 2); > > pdf_set_font($pdf, "HeiseiMin-W3", 30, "EUC-H"); > PDF_show_xy($pdf, "??????????", 10,150); > > pdf_set_font($pdf, "HeiseiKakuGo-W5", 30, "EUC-H"); > PDF_show_xy($pdf, "??????????", 10,100); > > PDF_end_page($pdf); > PDF_close($pdf); > fclose($fp); > ?> > > <a href="test.pdf">finished</a> > > How to solve this problem? If it is font related issue how do I install new > fonts in PDFLib? > > If this encoding related issue then I would like read some article about > encoding coversions and possible character loss. Is there any link > available? > > Can any one help me? > > -- > PHP Internationalization Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Internationalization Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php