<?php
header("Content-Type: text/html; charset=EUC-JP");
define("PARAM_FN", "c:/HaruPDF_Tips_106.pdf");
$objPdf = new HaruDoc;
$page = $objPdf->addPage();
$insFont = $objPdf->getFont("Courier-Bold");
$page->setFontAndSize($insFont, 30);
$sc = setColorRGB("0000FF");
$page->setRGBFill($sc['r'], $sc['g'], $sc['b']);
$page->beginText();
$page->textOut(40, 780, "Hello HaruPDF!");
$page->endText();
$objPdf->save(PARAM_FN);
function setColorRGB($hexcolor) {
$color['r'] = hexdec(substr($hexcolor, 0, 2))/255;
$color['g'] = hexdec(substr($hexcolor, 2, 2))/255;
$color['b'] = hexdec(substr($hexcolor, 4, 2))/255;
return $color;
}
?>
|