Introduction
- Who is this book for?
- How to read this book?
- About the author
What is Portable Document Format for?
- Quick look at the history
- Main features
- Which version to use?
- Differences between HTML and PDF
- Is PDF a right choice for me?
The structure of a PDF file
- Main goals
- Four parts of a file
- Write your own PDF in Notepad
- Compression
- Summary
An example document: an invoice
- An example invoice
- Basic HTML structure
- Body structure
- Creating a stylesheet
- Validating document syntax
- Summary
Choosing a tool to generate PDF files
- Two ways to create a PDF file
- Native PHP libraries
- External conversion tools
- Summary
Presenting a document to a user
- Displaying a PDF in a frame
- Browser window
- Downloading a PDF
- More about filenames
- Sending a PDF over email
- Saving a file
- Display preferences
- Summary
Understanding fonts
- How fonts work?
- Font file formats in the PDF
- Picking a proper font
- Selecting a font in CSS
- Text transformations
- ANSI or Mac versus Unicode
- Summary
Working with colors
- Color models
Metadata
- How it looks inside
- Entering metadata with TCPDF
- mPDF example
- Dompdf example
- WeasyPrint example
- Summary
Encryption
- Choosing the cipher
- User permissions
- Encryption with TCPDF
- Encryption with mPDF
- Encryption with Dompdf
- Encryption with FPDF
- Encrypting an existing file with command line tools
- Summary
Calling external programs from a PHP script
- Input, output and exit codes
- Basic execution from a PHP script
- Escaping arguments
- Opening and controlling a process
- The most convenient solution: The Process Component
- Reporting progress of time-consuming tasks
- Queueing tasks
- Summary
Styling pages with CSS
- Page dimensions and margins
- Adjusting individual pages
- Page-margin boxes and generated content
- Bleed area and crop marks
- Controlling page breaks
- Media queries
- Summary
Forms
- Building an HTML form
- Adding JavaScript validation
- Putting it all together
- How it works in a PDF reader
- Summary*
Reading and testing PDF files
- Metadata and text extraction
- Taking a screenshot
- Summary
Editing PDF files
- Importing a document to FPDF or TCPDF
- The PDF Toolkit
- Manipulating files with pdfjam
- Summary