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]*/
?>
HaruPage::showText
(PECL haru >= 0.0.1)
HaruPage::showText — Affiche le texte à la position courante de la page
Description
bool HaruPage::showText
( string
$text
)Affiche le texte à la position courante de la page.
Liste de paramètres
-
text -
Le texte à afficher.
Valeurs de retour
Retourne TRUE en cas de succès.
Erreurs / Exceptions
Émet une exception HaruException en cas d'erreur.
Voir aussi
- HaruPage::showTextNextLine() - Déplace la position courante au début de la prochaine ligne et affiche le texte
- HaruPage::textOut() - Affiche le texte à la position spécifiée
aku at syuaa dot net
09-Jun-2011 05:02
