Repository navigation
Added the function of converting multiple images into single PDF
π Release v1.2.0 - Multi-Image PDF Conversion
π Major Feature: Multi-PDF Support
We're excited to announce a major update to PDF Bot with the addition of Multi-Image PDF Conversion! Now you can combine multiple images into a single PDF document with professional formatting options.
β¨ What's New
π Multi-Image to PDF Conversion
Convert multiple images into a single, professionally formatted PDF document with ease.
Key Features:
- Interactive Collection: Real-time progress tracking as you send images
- Flexible Page Sizing: Choose between A4 Standard or Auto-Size modes
- Smart Layout: Automatic image centering with white borders
- Clean Interface: Single updating progress message (no spam!)
- Cancel Anytime: Built-in cancel buttons at every step
π― How It Works
- Start Collection: Send
/multipdf [optional_filename] - Add Images: Send your images one by one or as an album
- Track Progress: Watch the live counter update: "π₯ Downloaded 3 image(s)"
- Choose Mode: Click Done and select your preferred page size:
- π A4 Standard: Fixed 595Γ842px pages with white borders
- π Auto-Size: Optimized to the largest image dimensions
- Get PDF: Receive your professionally formatted PDF!
π§ Technical Improvements
Image Processing:
- β Color normalization with sRGB profiles
- β Intelligent resizing (max 2000px dimension)
- β Optimized JPEG compression (quality: 75, progressive)
- β Professional centering with aspect ratio preservation
Page Modes:
- A4 Standard: Perfect for printing, consistent 595Γ842px pages
- Auto-Size: Best for digital viewing, adapts to your images
Performance:
- β Real-time progress updates
- β Asynchronous download processing
- β Automatic cleanup of temporary files
- β Memory-efficient image optimization
π Updated Commands
New Commands
/multipdf [filename] - Start multi-image PDF collection
/done - Finish collection (or use Done button)
/cancel - Cancel collection (or use Cancel button)
Existing Commands (Unchanged)
/start - Display welcome message
/help - Show all available commands
/pdf [filename] - Convert single image to PDF
/compress [filename] - Compress PDF files
Benefits:
- β Visual progress tracking
- β One-click actions (no typing needed)
- β Professional, clean interface
π οΈ Technical Stack
PDF Generation:
- PyMuPDF (fitz) for advanced PDF creation
- Pillow (PIL) for image processing
- sRGB color profile management
Image Optimization:
- Maximum dimension: 2000px
- JPEG quality: 75 (optimized balance)
- Progressive encoding
- Chroma subsampling: 4:2:0
Architecture:
- Asynchronous processing with Pyrogram
- In-memory session management
- User-specific image collections
- Automatic 30-minute cleanup
π Example Usage
Basic Multi-PDF
/multipdf
β Send 3 photos
β Click Done
β Choose A4 or Auto-Size
β Receive PDF!
With Custom Filename
/multipdf vacation_2024
β Send photos
β Click Done
β Choose mode
β Get "vacation_2024.pdf"
Mixed with Single Images
Send photo β Reply with /pdf β Single image PDF
/multipdf β Send 5 photos β Done β Multi-image PDF
Send PDF β Reply with /compress β Compressed PDF
π Bug Fixes
- β Resolved download progress tracking issues
- β Improved error handling for failed downloads
- β Enhanced cleanup of temporary files
π€ Contributing
We welcome contributions! Feel free to:
- Report bugs via GitHub Issues
- Suggest features
- Submit pull requests
- Improve documentation
π License
This project is licensed under the MIT License.
π Acknowledgments
Special thanks to:
- PyMuPDF team for excellent PDF library
- Pyrogram developers for robust Telegram framework
- Community for feature requests and feedback
π Support
- Issues: GitHub Issues
Made with β€οΈ for the Telegram community