To create PDF file by PHP, you need some basic information. I record it here.
Page Sizes in PostScript Points
Paper Size – Page Width – Page Height
Letter – 612 – 792
Legal – 612 – 1008
A0 – 2380 – 3368
A1 – 1684 – 2380
A2 – 1190 – 1684
A3 – 842 – 1190
A4 – 595 – 842
A5 – 421 – 595
A6 – 297 – 421
It will be used, when I begin a page as below:

pdf_begin_page ($pdf, $width, $heifht);

Built-in PDF Fonts
courier
Courier-Bold
Courier-Bold Oblique
Courier-Oblique
Helvetica
Helvetica-Bold
Helvetica-Bold Oblique
Helvetica-Oblique
Symbol
Tuimes-Bold
Times-Bold Italic
Times-Italic
Times-Roman
Zapf Dingbats
And Font Encodings
Encoding : Description
winansi : Windows
macroman : Mac Roman (Macintosh default)
edcdic : EBCDIC, used on IBM AS/400 and S/390 systems
builtin : Coding built into the font itself
host : System-specific coding:macroman on the Mac, ebcdic on EBEDIC-based systems, and winansi on all others.

$font = pdf_findfont ($pdf, $font_name, $encoding);


Text Rendering
Option : Value
Fill : 0
Outline : 1
fill and Outline : 2
Invisible : 3

pdf_set_value ($pdf, “textrendering”, 2)

David Yin

David is a blogger, geek, and web developer — founder of FreeInOutBoard.com. If you like his post, you can say thank you here

One Reply to “PHP : Creating PDF”

Leave a Reply

Your email address will not be published. Required fields are marked *