- 论坛徽章:
- 0
|
Fatal error: Uncaught exception 'PDFlibException' with message 'Metrics data for font 'Arial' not found' in D:\wamp\www\forextjs\test.php:7 Stack trace: #0 D:\wamp\www\forextjs\test.php(7): pdf_findfont(Resource id #2, 'Arial', 'host', 1) #1 {main} thrown
下面是源程序- <?php
- phpinfo();
- $pdf = PDF_new();
- PDF_open_file($pdf, "LineExam.pdf ");
- PDF_begin_page($pdf, 595, 842);
- //设定Arial字体
- $arial = PDF_findfont($pdf, "Arial", "host", 1);
- PDF_setfont($pdf, $arial, 12);
- // 设定直线的颜色
- PDF_setcolor($pdf, "stroke ", "rgb ", 0, 0, 0);
- //画出直线
- PDF_moveto($pdf, 20, 780);
- PDF_lineto($pdf, 575, 780);
- PDF_stroke($pdf);
- // 在页面底部画出另外一条直线
- PDF_moveto($pdf, 20,50);
- PDF_lineto($pdf, 575, 50);
- PDF_stroke($pdf);
- // 输出一些文字
- PDF_show_xy($pdf, "Meng 's Corporation ", 200, 35);
- //结束PDF内容的绘制和制作
- PDF_end_page($pdf);
- //关闭PDF文档
- PDF_close($pdf);
- ?>
复制代码 |
|