HaruPage
在线手册:中文 英文
PHP手册

HaruPage::textOut

(PECL haru >= 0.0.1)

HaruPage::textOutPrint the text on the specified position

说明

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

Prints the text on the specified position.

参数

x

y

text

返回值

Returns TRUE on success.

错误/异常

发生错误时抛出 HaruException 异常。

参见


HaruPage
在线手册:中文 英文
PHP手册
PHP手册 - N: Print the text on the specified position

用户评论:

aku at syuaa dot net (09-Jun-2011 10:53)

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();
?>