Xojo FPDF - ZLib Module
ποΈ Make Your PDFs 60% Smaller - Everywhere
The Problem
PDF files can be huge. A 50-page report with images easily reaches 10-20 MB. Thatβs:
- β Slow to download
- β Expensive to store
- β Painful to email
- β Bandwidth-heavy
Worse yet: iOS sandboxing blocks access to system compression libraries, so your iOS app generates bloated PDFs while your Desktop app makes tiny ones.
The Solution
The VNS PDF Zlib Module provides pure Xojo compression that works identically on all platforms - especially iOS.
β¨ Key Benefits
Dramatic Size Reduction
- 27-60% smaller PDFs (typical)
- Works on text, fonts, images, and metadata
- Industry-standard FlateDecode compression
- Compatible with all PDF readers
iOS Support - Finally!
This is the killer feature.
Without Zlib Module (iOS):
pdf.Compressed = True // β Fails silently - no compression
// Result: 10 MB PDF
With Zlib Module (iOS):
pdf.Compressed = True // β
Works perfectly
// Result: 4 MB PDF (60% smaller)
Cross-Platform Consistency
The same PDF generated on Desktop, Web, iOS, and Console will be:
- β Identical file size
- β Identical compression ratio
- β Identical quality
No platform-specific code needed.
π Real-World Examples
Text-Heavy Documents
Before: 2.5 MB (uncompressed invoice with 1,000 line items) After: 0.9 MB (64% reduction)
Image-Rich Reports
Before: 15 MB (50-page report with charts and photos) After: 6 MB (60% reduction)
Font-Embedded Documents
Before: 800 KB (multi-page contract with TrueType fonts) After: 320 KB (60% reduction)
π§ Technical Excellence
Pure Xojo Implementation
- No external dependencies - No DLLs, dylibs, or .so files
- No Declares - No platform-specific API calls
- No Plugin - No third-party plugins required
- 100% Xojo - Native code that works everywhere
zlib 1.3.1 Compliant
- RFC 1950 (zlib format)
- RFC 1951 (DEFLATE compression)
- RFC 1952 (gzip format)
- Adler-32 checksum validation
Optimized Performance
- Fast compression (< 100ms for typical documents)
- Low memory footprint
- Streaming compression for large files
- Efficient Huffman encoding
πΌ Perfect For
iOS Applications The only way to get compressed PDFs on iOS without jailbreaking or workarounds.
Web Applications Reduce bandwidth costs and improve download times for user-generated PDFs.
Cloud Storage Save 60% on S3, Dropbox, or Google Drive storage costs.
Email Attachments Stay under email size limits with smaller PDFs.
Mobile Apps Reduce app data usage and improve user experience on slow connections.
Offline Documents Pack more documents into limited device storage.
π One-Line Activation
// That's it. Seriously.
pdf.Compressed = True
The Zlib Module integrates seamlessly with VNSPDFDocument. No API changes, no configuration, no complexity.
If the module is installed: Full compression works everywhere (including iOS). If the module is missing:Desktop/Linux use system zlib, iOS skips compression (free version behavior).
π± iOS: The Critical Use Case
Why iOS Needs This Module
iOS sandboxing prevents apps from accessing:
- β
/usr/lib/libz.dylib(system compression) - β External frameworks
- β Command-line utilities
Standard Xojo iOS apps cannot compress PDFs without this module.
The Alternative?
- Ship uncompressed PDFs (10x larger)
- Use cloud API for compression (requires internet, privacy risk)
- Ship a C-based compression framework (complex, risky)
The Smart Choice?
- Buy the Zlib Module ($49)
- Enable compression with one line
- Works offline, private, simple
π Under the Hood
Deflate Algorithm
- LZ77 sliding window compression
- Huffman coding for optimal bit packing
- Dynamic Huffman trees for better compression
- Block-level optimization
Adler-32 Checksums
Ensures data integrity - decompression validates the checksum to detect corruption.
PDF Integration
- Automatic /Filter /FlateDecode insertion
- Content stream compression
- Font stream compression
- Metadata compression
β What You Get
- β Full source code - VNSZlibPremium*.xojo_code (5 modules)
- β Deflate compression - Industry-standard algorithm
- β Inflate decompression - For future features
- β Adler-32 checksums - Data integrity validation
- β All platforms - Desktop, Web, iOS, Console
- β Documentation - Implementation guide and examples
- β 12 months free updates - Compatible with future versions
π Free vs Premium
| Feature | Free Version | Zlib Module |
|---|---|---|
| macOS compression | β System zlib (60%) | β Pure Xojo (60%) |
| Windows compression | β οΈ Requires ZLIB1.DLL | β No DLL needed |
| Linux compression | β System zlib (60%) | β Pure Xojo (60%) |
| iOS compression | β NONE (0%) | β Full (60%) |
| Web compression | β οΈ Platform-dependent | β Works everywhere |
| External dependencies | β οΈ DLLs/dylibs | β None |
| Cross-platform | β οΈ Inconsistent | β Identical everywhere |
Why upgrade? iOS is the killer feature. Without this module, your iOS PDFs are 2-3x larger than Desktop PDFs. For iOS apps or true cross-platform consistency, this module is essential.
π° Pricing
One-Time Purchase: β¬50
Special Offer: Buy 2, Get 1 Free! Mix and match any premium modules. Essential for iOS apps - combine with Encryption, Tables, PDF/A, Forms, or E-Invoice.
Whatβs Included:
- Complete zlib 1.3.1 implementation in pure Xojo
- Deflate compression and inflate decompression
- Adler-32 checksum module
- Huffman tree implementation
- 12 months free updates
- Installation guide and documentation
π³ Payment & Delivery
Payment: PayPal only (secure payment processing)
Delivery: Manual process - please allow 2-3 business days after payment for delivery via email.
You will receive:
- VNSZlibPremium*.xojo_code (5 source files)
- Complete documentation
- Installation guide
- License information
π Purchase
PayPal payment button below. After payment, youβll receive an email confirmation, and your module will be delivered within 2-3 business days.
Purchase Zlib Module - β¬50
π Compression Comparison
| Platform | Free Version | Zlib Module |
|---|---|---|
| macOS | System zlib (60% compression) | Pure Xojo (60% compression) |
| Windows | Requires ZLIB1.DLL | Pure Xojo (no DLL needed) |
| Linux | System zlib (60% compression) | Pure Xojo (60% compression) |
| iOS | β NO COMPRESSION | β 60% compression |
| Web | Platform-dependent | Pure Xojo (works everywhere) |
β Frequently Asked Questions
Q: Does this work on Desktop too? A: Yes! It works on all platforms. Desktop can use either system zlib (free) or pure Xojo (premium).
Q: Whatβs the compression ratio? A: Typically 27-60% depending on content. Text compresses better than images.
Q: Does it slow down PDF generation? A: Minimal impact. Compression typically adds < 100ms to generation time.
Q: Can I disable compression for specific documents? A: Yes. Set pdf.Compressed = False to disable compression for that document.
Q: Does it work with encrypted PDFs? A: Yes! Compression happens before encryption for maximum size reduction.
Q: Is the decompression code included? A: Yes! Inflate (decompression) is included for future features like PDF import.
π― Why This Matters
For iOS Developers: This is a must-have. Itβs the difference between shipping 10 MB PDFs and 4 MB PDFs.
For Web Developers: Reduce bandwidth costs and improve user experience.
For Enterprise: Compliance with file size limits and storage optimization.
For Everyone: Smaller PDFs = happier users.
Enable Compression Everywhere - β¬50
π‘ Bundle & Save: Buy 2 modules, get 1 free! View All Modules β
Free version: Desktop/Linux use system zlib. iOS has no compression.

