Introduction to FPDF

jeremycurcio1 4,968 views 28 slides Jul 17, 2013
Slide 1
Slide 1 of 28
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28

About This Presentation

An introduction to the FPDF Library for PHP. Learn how to create a basic invoice PDF using nothing but code.


Slide Content

Introduction to FPDF
Baltimore PHP - July 17, 2013
Presented By: Jeremy Curcio
Twitter: @Jeremy1026
Web: jcurcio.com

About Me
•My name is Jeremy Curcio
•Born and raised Baltimorean
•Working with PHP for about 7 years
•Currently working at Physicians Management Group

About FPDF
•First released in 2001
•Written by Olivier Plathey
•Completely free to use
•Requires no extensions*
•zlib is required to activate compression
•GD is required for GIF support

Overview
•www.fpdf.org/
•Download (ZIP / TAR)
•Tutorials
•Documentation
•User Forum

Abilities
•Automatic page breaks
•Automatic line breaks
•Text justification
•Color management
•Links
•Image support
•Page set up customization
•Set document meta data
•Title
•Author
•Keywords
•Supports many languages

Outputting Final PDF
•Can output finished PDF to
•Browser: $pdf->Output(‘invoice.php’, ‘I’);
•Forced Download: $pdf-
>Output(‘invoice.php’, ‘D’)
•Save to Server: $pdf-
>Output(‘pdfs/invoice.php’, ‘F’)

Commonly Used
API Methods
API Methods
•FPDF
•Constructor method
•FPDF([string orientation [, string unit [.
mixed size]]])
•Cell
•Cell(float w [, float h [, string txt [, mixed
border [, int ln [, string align [, boolean fill
[, mixed link]]]]]]]

Commonly Used
API Methods
API Methods
•Multiline Cell
•MultiCell(float w, float h, string txt[,
mixed border [, string align [, boolean
fill]]])
•Image
•Image(string file[, float x [, float y [, float
w [, float h [, string type [, mixed
link]]]]]])

Commonly Used
API Methods
API Methods
•Line Break
•Ln([float h])
•Set Font
•SetFont(string family [, string style [, float
size]])
•Set XY
•SetXY(float x, float y)

Creating The PDF

Other Capabilities
•Headers and Footers
•Links
•Color
•Add existing documents

Extendability
•Many extensions to FPDF are available
•Bookmark support
•Barcodes
•Circles/Ellipses
•Watermark
•Plus many more

Final Document
and Thoughts
and Thoughts
•Easy to make
•Highly versatile
•Hugely customizable

Questions?

Anyone have a printer? so i
can get Tim a hard copy
before we leave?

Questions?

Introduction to FPDF
Baltimore PHP - July 17, 2013
Presented By: Jeremy Curcio
Twitter: @Jeremy1026
Web: jcurcio.com