PHP Velho Oeste 2024

HaruPage::textOut

(PECL haru >= 0.0.1)

HaruPage::textOutテキストを指定した位置に表示する

説明

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

テキストを指定した位置に表示します。

パラメータ

x

y

text

返り値

成功した場合に TRUE を返します。

エラー / 例外

エラー時に HaruException をスローします。

参考

add a note add a note

User Contributed Notes 3 notes

up
0
dartmetrash at gmail dot com
8 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
8 years ago
The text shows up to the bottom right of the point (x,y).
up
-1
aku at syuaa dot net
12 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();
?>
To Top