I am working on Centos 5.6 trying to get PrinceXML to display chinese fonts.
This is the php code I am using:
<?
include("prince.php");
$prince = new Prince('/usr/bin/prince');
$prince -> setLog("/var/www/html/prince/error.log");
$prince->setHTML(true);
$xmlString=
'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
<title>Prince PHP class</title>
<style type="text/css">
body { font-family: AR PL KaitiM GB }
</style>
</head>
<body>
汉语/漢語
</body>
</html>
';
header('Content-Type: application/pdf');
header('Content-Disposition: inline; filename="foo.pdf"');
$prince->convert_string_to_passthru(($xmlString));
?>
Prince has the following error log:
Tue May 17 09:11:43 2011: ---- begin
Tue May 17 09:11:43 2011: Loading document...
Tue May 17 09:11:44 2011: Converting document...
Tue May 17 09:11:44 2011: warning: no glyphs for character U+6C49, fallback to '?'
Tue May 17 09:11:44 2011: warning: no glyphs for character U+8BED, fallback to '?'
Tue May 17 09:11:44 2011: warning: no glyphs for character U+6F22, fallback to '?'
Tue May 17 09:11:44 2011: warning: no glyphs for character U+8A9E, fallback to '?'
Tue May 17 09:11:44 2011: finished: success
Tue May 17 09:11:44 2011: ---- end
And indeed the chinese letters are changed into ? in the pdf
How do I fix this?
This is the php code I am using:
<?
include("prince.php");
$prince = new Prince('/usr/bin/prince');
$prince -> setLog("/var/www/html/prince/error.log");
$prince->setHTML(true);
$xmlString=
'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
<title>Prince PHP class</title>
<style type="text/css">
body { font-family: AR PL KaitiM GB }
</style>
</head>
<body>
汉语/漢語
</body>
</html>
';
header('Content-Type: application/pdf');
header('Content-Disposition: inline; filename="foo.pdf"');
$prince->convert_string_to_passthru(($xmlString));
?>
Prince has the following error log:
Tue May 17 09:11:43 2011: ---- begin
Tue May 17 09:11:43 2011: Loading document...
Tue May 17 09:11:44 2011: Converting document...
Tue May 17 09:11:44 2011: warning: no glyphs for character U+6C49, fallback to '?'
Tue May 17 09:11:44 2011: warning: no glyphs for character U+8BED, fallback to '?'
Tue May 17 09:11:44 2011: warning: no glyphs for character U+6F22, fallback to '?'
Tue May 17 09:11:44 2011: warning: no glyphs for character U+8A9E, fallback to '?'
Tue May 17 09:11:44 2011: finished: success
Tue May 17 09:11:44 2011: ---- end
And indeed the chinese letters are changed into ? in the pdf
How do I fix this?