HaruPage::showText

(PECL haru >= 0.0.1)

HaruPage::showTextPrint text at the current position of the page

설명

bool HaruPage::showText ( string $text )

Prints out the text at the current position of the page.

인수

text

The text to show.

반환값

Returns TRUE on success.

오류/예외

오류 시에 HaruException을 던짐.

참고

add a note add a note

User Contributed Notes 1 note

up
-1
aku at syuaa dot net
13 years ago
My First Hello Text

<?php

$text
= "Hello Text";

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

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

//Set margin top to 50 pixel
$mTop = 50;

//Set first yPos, you will need to reduce text height
$ypos = $page->getHeight()-$mTop-12;

$page->beginText();
$page->setFontandSize($font, 12);
$page->moveTextPos(100,$ypos,false);
$page->showText($text);
$page->endText();

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

/*[x]syuaa[x]*/
?>
To Top