IT. Expert System.

PHP

Basic PECL/haru example


Basic PECL/haru example

Example #1 Fancy "Hello world"

<?php

$doc 
= new HaruDoc;

$doc->setPageMode(HaruDoc::PAGE_MODE_USE_THUMBS); /* show thumbnails */

$page $doc->addPage(); /* add page to the document */
$page->setSize(HaruPage::SIZE_A4HaruPage::LANDSCAPE); /* set the page to use A4 landscape format */

$courier $doc->getFont("Courier-Bold"); /* we'll use the bundled font a few lines below */

$page->setRGBStroke(000); /* set colors */
$page->setRGBFill(0.70.80.9);
$page->rectangle(150150550250); /* draw a rectangle */

$page->fillStroke(); /* fill and stroke it */

$page->setDash(array(33), 0); /* set dash style for lines at this page */
$page->setFontAndSize($courier60); /* set font and size */

$page->setRGBStroke(0.50.50.1); /* set line color */
$page->setRGBFill(111); /* set filling color */

$page->setTextRenderingMode(HaruPage::FILL_THEN_STROKE); /* fill and stroke text */

/* print the text */
$page->beginText();
$page->textOut(210270"Hello World!");
$page->endText();

$doc->save("/tmp/test.pdf"); /* save the document into a file */

?>

Open the result document in your favourite PDF viewer and you should see a light-blue rectangle and white "Hello World!" on it.



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 815 / . Delta: 0.00873 с