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 — Imprime el texto en la posición actual de la página
Descripción
bool HaruPage::showText
( string
$text
)Imprime el texto en la posición actual de la página.
Parámetros
-
text -
The text to show.
Valores devueltos
Devuelve TRUE en éxito.
Errores/Excepciones
Lanza una HaruException cuando se produce un error.
Ver también
- HaruPage::showTextNextLine() - Mueve la posición actual a el inicio de la línea siguiente y imprime el texto
- HaruPage::textOut() - Imprime el texto en la posición especificada
aku at syuaa dot net ¶
1 year ago
