Home  |  Linux  | Mysql  | PHP  | XML
From:ShamunToha@osu1.php.net Date:Sun Oct  5 12:08:22 2008
Subject:note 86145 added to function.pdf-findfont
<?php
/*
 * This is an example of my first PDF test
 * Worked by NuSphere PHPed
 * Manualy downloaded library from 
 * http://pecl4win.php.net/ext.php/php_pdf.dll
 */
 
/*
 * Stage - 1
 * Resource create for PDF library
 */
$pdf = PDF_new();

/*
 * Stage - 2
 * Save where? Path to create the file.
 */
pdf_open_file($pdf, "c:\heloworld.pdf");

/*
 * Stage - 3
 * Page diemention (A4)
 */
pdf_begin_page($pdf, 595, 842);

/*
 * Stage - 4
 * path of your TTF font directory 
 * can also use pdf_load_font();
 * http://uk3.php.net/manual/en/function.pdf-findfont.php
 */
$fontdir = "C:\WINDOWS\Fonts"; 
pdf_set_parameter($pdf, "FontOutline", "arialMyName=$fontdir\arial.ttf");
$arial = PDF_findfont($pdf,"arialMyName","host",0 );

/*
 * Stage - 5
 * Set font size and font name
 */
pdf_setfont($pdf, $arial, 10);

/*
 * Stage - 6
 * print text
 */
pdf_show_xy($pdf, "Hellow World? ",50, 750); 
pdf_show_xy($pdf, "Test 1, 2, 3, 4 working. ", 50,730);

/*
 * Stage - 7
 * end page 
 */
pdf_end_page($pdf);

/*
 * Stage - 8
 * close and save file
 */
pdf_close($pdf);

?>

Output as pdf:
###################################
#
#   Hellow World?
#   Test 1, 2, 3, 4 working. 
#
###################################
----
Server IP: 87.124.35.190
Probable Submitter: 78.23.82.62
----
Manual Page -- http://www.php.net/manual/en/function.pdf-findfont.php
Edit        -- https://master.php.net/note/edit/86145
Del: integrated  -- https://master.php.net/note/delete/86145/integrated
Del: useless     -- https://master.php.net/note/delete/86145/useless
Del: bad code    -- https://master.php.net/note/delete/86145/bad+code
Del: spam        -- https://master.php.net/note/delete/86145/spam
Del: non-english -- https://master.php.net/note/delete/86145/non-english
Del: in docs     -- https://master.php.net/note/delete/86145/in+docs
Del: other reasons-- https://master.php.net/note/delete/86145
Reject      -- https://master.php.net/note/reject/86145
Search      -- https://master.php.net/manage/user-notes.php

Navigate in group php.notes at sever news.php.net
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by Zareef Ahmed
Powered By PHP Consultants