Generate a PDF with PHP




Learn how to generate a PDF file using PHP.

PDF files are useful because the formatting is always reliable – its contents will always display in exactly the same way no matter where you are viewing it.

Full PHP course:

Please consider supporting my channel:

In this video you’ll learn how to:
• use the Dompdf library to generate a PDF file
• make the browser download the file or open it inline
• add styling to the PDF content
• insert images
• insert user-supplied, dynamic content
• use inline, embedded and external CSS for styling
• save the generated PDF file locally

Also learn how to easily fix the common Dompdf problem when inserting images: “Image not found or type unknown”.

Code shown in the video:

Dompdf package:

Sample image:

Thumbnail icon:

CSS:

00:00 Introduction
00:35 Install Dompdf
01:02 Basic PDF generation
02:49 Change PDF filename
03:25 Display PDF inline
04:21 Styling and layout
05:23 Images
06:14 Setting options 1
06:47 Setting options 2
07:36 Setting page options
08:16 Document metadata
09:08 Create the form
10:11 Classless CSS
10:42 Dynamic data
11:55 HTML template
16:19 Using CSS
17:52 Enable remote resources
18:13 Save PDFs locally
18:59 Summary

#PHP #PDF…(read more)


Convert Word 2 PDF: Word to PDF Converter

Convert PowerPoint 2 PDF: PPT to PDF Converter

Convert Excel 2 PDF: Excel to PDF Converter

Convert an Image 2 PDF: Image to PDF Converter

Convert HTML 2 PDF: HTML to PDF Converter

More Tools: PDF Converter