略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: HaruPage::textOut

2024-03-28

HaruPage::textOut

(PECL haru >= 0.0.1)

HaruPage::textOutPrint the text on the specified position

说明

HaruPage::textOut ( float $x , float $y , string $text ) : bool

Prints the text on the specified position.

参数

x

y

text

返回值

Returns TRUE on success.

错误/异常

发生错误时抛出 HaruException 异常。

参见

add a note add a note

User Contributed Notes 3 notes

up
0
dartmetrash at gmail dot com
3 years ago
The text is placed up and to the right of the point given. The point given is the baseline, left of the text.
up
0
Anonymous
3 years ago
The text shows up to the bottom right of the point (x,y).
up
-1
aku at syuaa dot net
7 years ago
a simple sample of textOut :

<?php

$text
= "Syuaa is another little programmer";

$doc=new HaruDoc;
$page=$doc->addPage();

//load haru font Times-Roman
$font = $doc->getFont('Times-Roman');

//Begin creating text on x100, y150
$page->beginText();
$page->setFontandSize($font, 12);
$page->textOut(100, 150, $text);
$page->endText();

//Open as pdf
header('Content-type: application/pdf');
$doc->output();
?>

官方地址:https://www.php.net/manual/en/harupage.textout.php

冷却塔厂家 广告
-- 广告
北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3