では動作しません。私が使用 コード:は、私は入力からPDFを生成する<code>dompdf</code>を使用していますPHPのPDFジェネレータクラス
require_once (STYLESHEETPATH.'/dompdf/include/autoload.inc.php');
set_include_path(STYLESHEETPATH.'/dompdf');
require_once STYLESHEETPATH.'/dompdf/dompdf_config.inc.php';
$dompdf = new DOMPDF();
$html = '
<html>
<body>
<h1>Hello <i>'. $fullname.'</i> </h1>
<p> your father is <b>'.$fathername.'</b>
</body>
</html>';
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("tck.pdf"); ?>
これは非常に正常に動作してPDFを生成しますが、今私は、PDF内のフォントのスタイルをしたいtck.pdf
と呼ばれるので、私は
require_once (STYLESHEETPATH.'/dompdf/include/autoload.inc.php');
set_include_path(STYLESHEETPATH.'/dompdf');
require_once STYLESHEETPATH.'/dompdf/dompdf_config.inc.php';
$dompdf = new DOMPDF();
$html = '
<html>
<head>
<style>
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 400;
src: url(http://themes.googleusercontent.com/static/fonts/opensans/v8/cJZKeOuBrn4kERxqtaUH3aCWcynf_cDxXwCLxiixG1c.ttf) format("truetype");
}
</style>
</head>
<body>
<h1>Hello <i>'. $fullname.'</i> </h1>
<p> your father is <b>'.$fathername.'</b>
<br/>
<span style="font-family:webfontregular;">bar code will be here</span>
<div style="font-family:"Open Sans";">Open Sans</div>
</body>
</html>';
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("tck.pdf"); ?>
を試みた。しかし次のようにエラーが発生します。
Fatal error: Class 'Font' not found in /home4/q0i4l0g2/public_html/tck/wp-content/themes/kallyas-child/dompdf/include/font_metrics.cls.php on line 356
私は "@ font-face"を使用するたびにこのエラーが発生していることに気付きました。 なぜですか? どうすれば動作させることができますか?
この質問Dompdf and set different font-familyで受け入れ答えあたりのように、これは私が考えて動作するはずですが、それはしません。
[DOMPDF - Class 'Font'が見つかりません]複製可能です(http://stackoverflow.com/questions/22226218/dompdf-class-font-not-found) – Chris
@Chrisいいえ、答えはそれの質問は、だからあなたはあなたがPHP-フォント-libがダウングレードしようとしたと言ってい –
...この質問のための4 upvotesを取得する機会がありません。この問題を解決しましたか? – Chris