10-6.php
来自「《php程序设计》的配套源码 《php程序设计》的配套源码 《php程序」· PHP 代码 · 共 23 行
PHP
23 行
<?php
$p = pdf_new();
pdf_open_file($p);
pdf_set_info($p,"Creator","hello.php");
pdf_set_info($p,"Author","Rasmus Lerdorf");
pdf_set_info($p,"Title","Hello world (PHP)");
pdf_set_parameter($p, "resourcefile",
'/usr/local/lib/fonts/pdflib.upr');
pdf_begin_page($p,612,792);
pdf_set_text_pos($p,25,750);
$fonts = array('Courier'=>0,'Courier-Bold'=>0,'Courier-BoldOblique'=>0,
'Courier-Oblique'=>0,'Helvetica'=>0,'Helvetica-Bold'=>0,
'Helvetica-BoldOblique'=>0,'Helvetica-Oblique'=>0,
'Times-Bold'=>0,'Times-BoldItalic'=>0, 'Times-Italic'=>0,
'Times-Roman'=>0, 'LuciduxSans'=>1,
'Georgia' => 1, 'Arial' => 1, 'Century Gothic' => 1,
'Century Gothic Bold' => 1, 'Century Gothic Italic' => 1,
'Century Gothic Bold Italic' => 1
);
foreach($fonts as $f=>$embed) {
$font = pdf_findfont($p,$f,"host",$embed);
pdf_setfont($p,$font,25.0);
pdf_continue_text($p,"$f (".chr(128)."
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?