<?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
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.