PDF Format Overview
PDF (Portable Document Format) was created by Adobe in 1992 and became an ISO standard (ISO 32000) in 2008. Understanding its structure helps explain why some operations are fast (merging) while others are complex (editing text).
Four Main Parts of a PDF
Every PDF file contains four sections:
- β’Header: Version number (e.g., %PDF-1.7)
- β’Body: Objects containing actual content (text, images, fonts)
- β’Cross-reference table: Index for quick object lookup
- β’Trailer: Points to the root object and cross-reference table
Why Merging is Simple
PDF merging is essentially combining object collections and updating references. The actual content (text rendering, fonts, images) doesn't change. This is why merging preserves quality perfectly and runs quickly.
Why Text Editing is Hard
Text in PDFs isn't stored like a Word document. Instead:
- β’Text is positioned using absolute coordinates
- β’Each character may have individual positioning
- β’Fonts may be subsetted (only used characters included)
- β’Editing text means recalculating positions for everything after
Image Compression in PDFs
PDFs can contain images in various formats:
| Format | Best For | Compression Potential |
|---|---|---|
| JPEG | Photos | Already compressed, limited further reduction |
| PNG/Flate | Screenshots, diagrams | Good compression possible |
| JPEG2000 | High-quality images | Better than JPEG but slower |
| JBIG2 | Black & white scans | Excellent for text documents |
PDF/A for Archiving
PDF/A is an ISO-standardized version of PDF designed for long-term archiving. It requires all fonts to be embedded and prohibits encryption, JavaScript, and external references. Government and legal documents often require this format.
