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();
?>
HaruPage::textOut
(PECL haru >= 0.0.1)
HaruPage::textOut — テキストを指定した位置に表示する
説明
bool HaruPage::textOut
( float
$x
, float $y
, string $text
)テキストを指定した位置に表示します。
パラメータ
-
x -
-
y -
-
text -
返り値
成功した場合に TRUE を返します。
エラー / 例外
エラー時に HaruException をスローします。
参考
- HaruPage::showTextNextLine() - 現在位置を次の行の行頭に移動してテキストを表示する
- HaruPage::showText() - ページの現在位置にテキストを表示する
aku at syuaa dot net
09-Jun-2011 11:53
