Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF TOOL BOT Banner



Live Demo Bot Channel Website Support

The Ultimate Telegram Document Engineering Suite.
44 Atomic Operations • Tesseract OCR • Universal Converters • 17 Languages • Academic LibGen Hub

Overview • Features • 44+ Ops • Commands • Deploy • Configuration • Setup



Animated Sticker    Animated Sticker    Animated Sticker    Animated Sticker    Animated Sticker    Animated Sticker

Overview

PDF TOOL BOT is an asynchronous document engineering system built natively for Telegram. Powered by Python 3.11, Kurigram (asynchronous Pyrogram framework), PyMuPDF (fitz), Tesseract 5 OCR, Ghostscript, and Motor (async MongoDB), it delivers 44 production-grade document transformations with sub-second execution speeds and zero quality degradation.

Send any PDF file to the bot. An interactive inline keyboard generates dynamically. Select an operation, and the result is delivered back instantly.

Important

Production Requirements: Telegram Bot Token from @BotFather, API ID and API Hash from my.telegram.org, an active MongoDB instance, and Ghostscript on the host system.



Features & Capabilities

Core PDF Surgery & Manipulation

  • Multi-File Merge: Send multiple PDF files into the active session queue and merge them into a single ordered master document.

  • Precision Splitter: Slice documents by arbitrary page ranges (e.g. 1-10, 15,22,30) or split on demand.

  • Selective Page Extractor: Isolate specific pages or chapters into a brand-new standalone PDF without quality loss.

  • Page Deleter: Remove unwanted blank sheets, copyright disclaimers, or cover pages by index.

  • 360 Degree Rotator: Reorient orientation clockwise or counter-clockwise (90 deg, 180 deg, 270 deg, 360 deg).

  • Zoom & Margin Calibrator: Dynamically scale document viewport bounding boxes with custom margin expansion.

  • Form Field Flattening: Convert dynamic, interactive fillable PDF forms into immutable static printable pages.

  • Automatic Page Numbering: Stamp uniform, sequential numbering across every page header or footer automatically.

  • Bookmark & TOC Inspector: Inspect and extract the embedded table-of-contents hierarchy from technical books and papers.

  • Hyperlink Stripper: Scrub all embedded promotional web links and tracking URLs with a single tap.

  • Cover Page Preview: Generate high-resolution graphical preview images of document cover pages.

Smart Compression & Visual Studio

  • Multi-Tier Compression: Ghostscript backend engine with calculated size savings feedback:
    • Low (Best Quality): Uses /printer profile for high-res print outputs.
    • Medium (Balanced): Uses /ebook profile for crystal-clear digital reading.
    • High (Smallest Size): Uses /screen profile for compact email attachments.

  • Tri-Modal Watermark Studio:
    • Text Watermark: Custom text overlay with 10% to 100% opacity tuning and Top, Middle, or Bottom alignment.
    • Image Watermark: Stamp your personal logo or brand PNG directly across all pages.
    • PDF Watermark: Merge a transparent background template PDF under each page.

  • Official Stamp Presets: 14 bureaucratic stamps (Approved, Confidential, Top Secret, Draft, Expired, Final, Sold, For Public Release...) across 6 colors (Red, Blue, Green, Yellow, Pink, Black).

  • Dark Mode Inverter: Inverts color schemes for comfortable reading in dark environments.

  • Black & White Grayscale: Converts documents into pure monochrome for ink-saving printing.

  • Artistic Sketch Filter: Transforms pages into stylized hand-drawn pencil sketches.

  • Header & Footer Injector: Injects custom text banners at top or bottom page margins.

Universal Converters & N-Up Imposition

  • PDF to Microsoft Word (DOCX): Converts documents into fully editable Word files with intact paragraphs and formatting.

  • PDF to Microsoft Excel (XLSX): Detects tabular layouts and extracts raw data directly into structured spreadsheets.

  • PDF to PowerPoint (PPTX): Transforms document presentation slides into editable PowerPoint decks.

  • PDF to High-DPI Images: Renders every page into PNG or JPEG image files. Export as single images, document formats, or compressed .ZIP / .TAR packages.

  • Images to Single PDF: Send multiple pictures (JPG, PNG) in chat and click generate to create an aggregated PDF document.

  • Text to Formatted PDF: Paste raw text directly into the bot to produce an elegant PDF with custom fonts and font sizes.

  • Structured Text Extraction: Exports embedded text as plain text (.TXT), web-ready markup (.HTML), or machine-readable .JSON.

  • N-Up Sheet Imposition (Study Handouts):
    • 1 x 2 & 2 x 1: Two pages per sheet (Horizontal / Vertical).
    • 1 x 3 & 3 x 1: Three pages per sheet (Horizontal / Vertical).
    • 2 x 2: Four pages per sheet in a compact 4-quadrant grid.

OCR, Academic Research & Security

  • Tesseract 5 OCR Engine: Converts scanned, photographed, or unselectable PDFs into copyable, searchable text layers without distortion.

  • Library Genesis (LibGen) Research Hub: Search academic research papers, journals, and books directly from Telegram with mirror selection and Cloudflare bypass.

  • Web URL to PDF Ingest: Send direct download links or document URLs; the bot fetches and converts them into Telegram documents automatically.

  • Telegram Message to PDF: Render formatted Telegram messages into clean PDF documents.

  • Cryptographic AES Encryption: Lock documents with user and owner passwords via military-grade AES-256 encryption.

  • Instant Password Decryption: Remove password restrictions from your owned protected files.

  • Irreversible Redaction: Permanently black out confidential data, names, figures, and sensitive sections before public distribution.

  • Digital Signature: Insert verified signature blocks and embed dynamic scannable QR codes anywhere on your pages.

  • QR Code Stamping: Synthesizes and stamps a custom QR code onto pages.

  • Unified AIO (All-in-One) Pipeline: Handles password-protected files and applies continuous chains of operations (decrypt, compress, watermark, rename) in a single session.

  • Deep Linking & Shareable URLs: Generate secure Telegram deep links allowing others to open specific processed files right inside the bot.


44+ Operations Catalog

Every operation implemented directly in the source code (dispatch/reactor/ops/):

Click to expand the complete 44+ Operations Catalog

1. Document Architecture & Assembly

File Operation Description
pdf_merge.py Merge Concatenates multiple PDF files into one ordered master file
pdf_split.py Split Slices PDF documents by custom page range or specific pages
pdf_extract.py Extract Pulls out designated pages into a new standalone PDF
pdf_combine.py Combine Interleaves and combines disparate page batches
pdf_deletepage.py Delete Page Removes unwanted single pages or ranges by index
pdf_compress.py Compress Ghostscript compression: Low (/printer), Medium (/ebook), High (/screen)
pdf_rotate.py Rotate Corrects document orientation: 90 deg, 180 deg, 270 deg, 360 deg
pdf_zoom.py Zoom Adjusts inner page zoom scale and border padding margins
pdf_rename.py Rename Safely renames files without modifying internal binary payloads
pdf_preview.py Preview Renders high-fidelity graphical preview of the cover page
pdf_metadata.py Metadata Inspects document metadata (Title, Author, Subject, Keywords, Creator)
pdf_flatten.py Flatten Flattens interactive form fields into static immutable pages
pdf_pagenum.py Page Numbers Automatically inserts page numbers across every page
pdf_bookmarks.py Bookmarks Reads and exports the document Table of Contents outline
pdf_striplinks.py Strip Links Purges all clickable hyperlinks and tracking URLs from pages

2. Visual Enhancements & Artistry

File Operation Description
pdf_bw.py Black & White Converts color pages to ink-saving monochrome grayscale
pdf_invert.py Invert Colors Inverts colors for eye-friendly dark/night mode reading
pdf_saturate.py Saturate Adjusts color vibrancy and saturation levels
pdf_draw.py Draw / Sketch Applies an artistic pencil-sketch visual filter

3. Watermarking, Stamps & Identity

File Operation Description
pdf_watermark.py Watermark (Text/Image/PDF) Full watermark engine with 10% to 100% opacity and Top/Mid/Bottom alignment
pdf_watermark45.py Watermark 45 deg Classic diagonal 45-degree watermark positioning
pdf_stamp.py Official Stamp 14 official bureaucratic stamps in 6 selectable colors
pdf_header.py Header Injects custom banner text across top page margins
pdf_footer.py Footer Injects custom banner text across bottom page margins
pdf_redact.py Redact Permanently censors and blacks out sensitive document regions
pdf_sign.py Digital Sign Inserts a visual signature block for document approval
pdf_qr.py QR Code Synthesizes and stamps a custom QR code onto pages

4. Sheet Imposition (N-Up Layouts)

File Operation Description
pdf_format.py Format Hub Master selection router for 1x1, 1x2, 2x1, 1x3, 3x1, 2x2
pdf_2in1.py 2-in-1 Vertical 2 pages printed vertically on a single sheet
pdf_2in1h.py 2-in-1 Horizontal 2 pages printed horizontally on a single sheet
pdf_3in1.py 3-in-1 Vertical 3 pages printed vertically on a single sheet
pdf_3in1h.py 3-in-1 Horizontal 3 pages printed horizontally on a single sheet

5. Format Conversion & Data Extraction

File Operation Description
pdf_to_word.py PDF to DOCX Headless LibreOffice conversion to editable Microsoft Word
pdf_to_excel.py PDF to XLSX Extracts tabular layouts into Microsoft Excel spreadsheets
pdf_to_ppt.py PDF to PPTX Converts presentation slides into editable PowerPoint files
pdf_to_images.py PDF to Images Converts pages to PNG/JPEG images (Individual, Document, ZIP, TAR)
pdf_text.py PDF to Text Extracts document text and exports as TXT, HTML, or JSON
pdf_encrypt.py Encrypt Applies cryptographic password lock with AES-256
pdf_decrypt.py Decrypt Unlocks encrypted PDFs using verified user password
pdf_archive.py Archive Bundles and compresses PDF files into ZIP or TAR archives

6. OCR, Intelligence & Academic Search

File Operation Description
pdf_ocr.py Tesseract OCR Converts non-selectable scanned PDFs into searchable text documents
pdf_deeplink.py Deep Link Generates shareable bot deep links to retrieve stored documents
pdf_message.py Message to PDF Converts long chat text messages into clean PDF documents
fetcher.py URL Downloader Direct remote HTTP/HTTPS document fetcher
finder.py LibGen Search Library Genesis paper & book search with Cloudflare bypass


Commands Guide

User Commands

Command Action Details
/start Initialize Bot Displays welcome panel, language detection, and quick setup guide
/lang Change Language Opens language selection menu supporting 17 international languages
/help Operations Guide Explains available features and gives direct inline keyboard tips

Note

No Command Memorization Needed: Simply upload any PDF document to the bot. An interactive inline keyboard appears with instant buttons for every tool.

Administrator Commands

Command Syntax Description
/stats /stats Displays real-time server health (Disk storage, RAM usage, CPU load, Active database users)
/ban /ban <user_id> Permanently bans a user from accessing the bot infrastructure
/unban /unban <user_id> Restores access permissions for a previously banned user
/donate /donate Displays donation and support options


17 Supported Languages

Full localized interface covering menus, buttons, status indicators, and prompts:

Language Code Language Code Language Code
English en Hindi (Hindi) hi Arabic (Arabic) ar
Spanish (Espanol) es French (Francais) fr German (Deutsch) de
Russian (Russian) ru Chinese (Chinese) zh Japanese (Japanese) ja
Portuguese (Portugues) pt Korean (Korean) ko Italian (Italiano) it
Turkish (Turkce) tr Persian (Farsi) fa Bengali (Bengali) bn
Urdu (Urdu) ur Indonesian (Bahasa) id


Deployment

Deploy your own high-performance instance with a single click:

Render Koyeb Railway Heroku
Deploy to Render Deploy to Koyeb Deploy on Railway Deploy to Heroku


Configuration & Environment

Copy the template and fill in your credentials:

cp config.env.example config.env

Core Variables (Required)

Variable Type Description
B_TOKEN String Telegram Bot Token obtained from @BotFather
API_ID Integer Telegram API App ID from my.telegram.org
API_HASH String Telegram API Hash string from my.telegram.org
MONGODB_URI String MongoDB connection URI (mongodb+srv://...) for storing user preferences
ADMINS String Space-separated Telegram user IDs who have admin permissions

Optional Configuration

Variable Type Default Description
LOG_CHANNEL Integer None Telegram channel ID to receive operational and error logs
FORCE_SUB String None Telegram channel username for compulsory subscription verification
FORCE_SUB2 String None Second channel username for dual force-subscription check
MAX_FILE_SIZE Integer 200 Maximum allowable input file size in megabytes (MB)
MULTI_LANG_SUP Boolean True Automatically detect client language from user profile
SOURCE_CODE String "" Repository URL displayed in information and about panels
OWNED_CHANNEL String "" Official updates channel URL linked in menus
PORT Integer 8080 Keep-alive HTTP pulse server port for Render and Koyeb platforms


Local Installation

Prerequisites

  • Python 3.11+
  • Ghostscript (gs binary for PDF level-compression)
  • Tesseract OCR (tesseract engine for OCR text layer generation)
  • LibreOffice (Headless engine for DOCX, XLSX, PPTX conversion)
# 1. Clone repository
git clone https://github.com/RoxyBasicNeedBot/PDF-TOOL-BOT.git
cd PDF-TOOL-BOT

# 2. Setup virtual environment
python -m venv venv
venv\Scripts\activate          # Windows PowerShell / CMD
# source venv/bin/activate     # Linux / macOS

# 3. Install dependencies
pip install -r requirements.txt

# 4. Configure environment
cp config.env.example config.env
# Edit config.env with your real credentials

# 5. Start the bot
python -m ROXYBASICNEEDBOT


Acknowledgments

  • PyMuPDF (fitz) - High-performance C-backed PDF rendering and manipulation library
  • Kurigram - Asynchronous Pyrogram MTProto client fork
  • Tesseract OCR - World-class optical character recognition engine
  • Ghostscript - PostScript and PDF compression engine
  • LibreOffice - Headless office document conversion system
  • Motor - Asynchronous MongoDB driver for Python


Duck Sticker      Duck Sticker      Duck Sticker      Duck Sticker


Live Demo   GitHub Stars   GitHub Forks   Telegram Channel   Website

Back to Top • Report Issue • Submit Pull Request

If PDF TOOL BOT improved your workflow, consider giving it a Star on GitHub.

(C) 2026 RoxyBasicNeedBot. All Rights Reserved.

About

🎯 All-in-one PDF assistant: • Convert images to PDF • Compress & optimize • Split, merge & extract • Add watermarks & stamps • Lock or unlock files • Search a vast book catalog Drop a document or use a com

Resources

Stars

11 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages