SlideShare a Scribd company logo
Introduction to FPDF
DC PHP - August 14, 2013
Presented By: Jeremy Curcio
Twitter: @Jeremy1026
Web: jcurcio.com
Sorry
About Me
• My name is Jeremy Curcio
• Born and raised Baltimorean
• Or Baltimoron
• Working with PHP for about 7 years
• Currently employeed with at TapFury
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
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
Introduction to FPDF - DC PHP
Introduction to FPDF - DC PHP
Introduction to FPDF - DC PHP
Introduction to FPDF - DC PHP
Introduction to FPDF - DC PHP
Introduction to FPDF - DC PHP
Introduction to FPDF - DC PHP
Introduction to FPDF - DC PHP
Introduction to FPDF - DC PHP
Introduction to FPDF - DC PHP
Introduction to FPDF - DC PHP
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 Sandy a hard copy
before we leave?
Questions?
Introduction to FPDF
DC PHP - August 14, 2013
Presented By: Jeremy Curcio
Twitter: @Jeremy1026
Web: jcurcio.com

More Related Content

PPT
Reporting using FPDF
PDF
Web fonts
PDF
PPT
Introduction to FPDF
PPT
The FPDF Library
ODP
PHP and PDFLib
PDF
PPTX
PDF Forms
Reporting using FPDF
Web fonts
Introduction to FPDF
The FPDF Library
PHP and PDFLib
PDF Forms

Similar to Introduction to FPDF - DC PHP (13)

PPTX
Taming the resource tiger
PPT
UNIT-IV WT web technology for 1st year cs
PPTX
Taming the resource tiger
PDF
Adobe AIR & Printing
PPT
Introduction to Zend_Pdf
KEY
Charts, PDFs, and PHP
PPT
Zend framework 06 - zend config, pdf, i18n, l10n, sessions
PDF
Advanced PHP: Design Patterns - Dennis-Jan Broerse
 
PDF
Rasmus, Think Again! Agile Framework == Happy Php Developer
PDF
Phpconf taiwan-2012
PDF
PHP 5.3 in practice
KEY
CakePHP - The Path to 2.0
PPTX
10 Reasons ColdFusion PDFs should rule the world
Taming the resource tiger
UNIT-IV WT web technology for 1st year cs
Taming the resource tiger
Adobe AIR & Printing
Introduction to Zend_Pdf
Charts, PDFs, and PHP
Zend framework 06 - zend config, pdf, i18n, l10n, sessions
Advanced PHP: Design Patterns - Dennis-Jan Broerse
 
Rasmus, Think Again! Agile Framework == Happy Php Developer
Phpconf taiwan-2012
PHP 5.3 in practice
CakePHP - The Path to 2.0
10 Reasons ColdFusion PDFs should rule the world
Ad

Recently uploaded (20)

PDF
Getting Started with Data Integration: FME Form 101
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
WOOl fibre morphology and structure.pdf for textiles
PPTX
The various Industrial Revolutions .pptx
PDF
STKI Israel Market Study 2025 version august
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
Modernising the Digital Integration Hub
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
project resource management chapter-09.pdf
PDF
Developing a website for English-speaking practice to English as a foreign la...
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PPT
Module 1.ppt Iot fundamentals and Architecture
Getting Started with Data Integration: FME Form 101
Group 1 Presentation -Planning and Decision Making .pptx
Enhancing emotion recognition model for a student engagement use case through...
Final SEM Unit 1 for mit wpu at pune .pptx
WOOl fibre morphology and structure.pdf for textiles
The various Industrial Revolutions .pptx
STKI Israel Market Study 2025 version august
Hindi spoken digit analysis for native and non-native speakers
Univ-Connecticut-ChatGPT-Presentaion.pdf
Modernising the Digital Integration Hub
Zenith AI: Advanced Artificial Intelligence
A contest of sentiment analysis: k-nearest neighbor versus neural network
observCloud-Native Containerability and monitoring.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
DP Operators-handbook-extract for the Mautical Institute
A comparative study of natural language inference in Swahili using monolingua...
project resource management chapter-09.pdf
Developing a website for English-speaking practice to English as a foreign la...
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
Module 1.ppt Iot fundamentals and Architecture
Ad

Introduction to FPDF - DC PHP

  • 1. Introduction to FPDF DC PHP - August 14, 2013 Presented By: Jeremy Curcio Twitter: @Jeremy1026 Web: jcurcio.com
  • 3. About Me • My name is Jeremy Curcio • Born and raised Baltimorean • Or Baltimoron • Working with PHP for about 7 years • Currently employeed with at TapFury
  • 4. 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
  • 5. Overview • www.fpdf.org/ • Download (ZIP / TAR) • Tutorials • Documentation • User Forum
  • 6. Abilities • Automatic page breaks • Automatic line breaks • Text justification • Color management • Links • Image support • Page set up customization
  • 7. 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’)
  • 8. 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]]]]]]]
  • 9. 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]]]]]])
  • 10. 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)
  • 23. Other Capabilities • Headers and Footers • Links • Color • Add existing documents
  • 24. Extendability • Many extensions to FPDF are available • Bookmark support • Barcodes • Circles/Ellipses • Watermark • Plus many more
  • 25. Final Document and Thoughts and Thoughts • Easy to make • Highly versatile • Hugely customizable
  • 27. Anyone have a printer? so i can get Sandy a hard copy before we leave?
  • 29. Introduction to FPDF DC PHP - August 14, 2013 Presented By: Jeremy Curcio Twitter: @Jeremy1026 Web: jcurcio.com

Editor's Notes

  • #3: Family Violence Prevention Fund
  • #5: Free to use in all applications, be they free or commercial, with and without modifications I use FPDF library at work -> Doctors office -> Receipts
  • #6: Frames Download available in ZIP/TAR A handful of tutorials Documentation well written User forum not overly active
  • #7: Arabic based languages, Cyrillic, Greek, Thai, Chinese, Japanese, Korean, also possible to use any TrueType or Type1 font with desired character set
  • #8: Browser Forced Download Server Going to create a simple invoice using static data
  • #9: Portrait/Landscape, PT/MM/CM/IN, A3/A4/A5/Letter/Legal Width-if 0 extend to right margin, height-defaults to 0, txt-string to print, border-0 none (default) 1 frame LTRB sides, ln-where position should go after cell, 0 (default) to right 1 beginning of next line 2 below, align-L (default) C R, fill-cell background to be filled, link-makes cell a link
  • #10: Almost the same as Cell, height is per line, not per multicell except has automatic line breaks file-path/url of image, x-upperleft of image, y-upperright of image, w-width of image, h-height of image, type-image format usually inferred by extension, link-ability to make image a link
  • #11: h-height of break, defaults to height of last cell family-name of font, style-B I U or combination, size-size of font in points default is current size or 12 if not previously set Sets abscissa and ordinate of the current position, where the next cell/image/etc. will be placed. Negative values are from the bottom-right of the page Also available is SetX and SetY if you only have to change one value
  • #12: Going to make an invoice.
  • #13: Create FPDF object Add a page Set meta data Output to browser, with the document name being set to ‘invoice.pdf’
  • #14: Page size Document title Meta data-title, author.
  • #15: Add logo image Set the starting X/Y positions “SetXY” Set font and size “SetFont” Add text “Cell” and “MultiCell”
  • #17: Reset X/Y Adjust font settings Add more text Add line break “Ln”
  • #19: MultiCell supports line explicit line breaks \n
  • #20: Go through the data and create a table from it Last ‘1’ in cell means add border all around
  • #24: Headers and footers can be set to automatically print on each page Links can be added to any text or image Text can be colored If you have a standard pdf of legal text that you attach, you can import that pdf as a new page(s) to your document
  • #25: Many available on fpdf.org, many more just a google search away
  • #26: Less than 100 lines Can be used to create a PDF for any purpose