Skip to content

kmacprt/pdfbot

Repository files navigation

Telegram PDF Bot

Telegram Bot MIT License Build Status Codacy Badge Code style: black Crowdin Telegram Channel

A PDF utility bot on Telegram that can:

  • Crop, decrypt, encrypt, merge, preview, rename, rotate, scale and split a PDF file
  • Compare text differences of two PDF files
  • Create a PDF file from text messages
  • Add watermark to a PDF file
  • Add a text layer to a PDF file to make it searchable
  • Extract text from a PDF file
  • Extract images in a PDF file and convert a PDF file into images
  • Beautify and convert photos into PDF format
  • Convert a web page into a PDF file

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes

Setup Database

The bot uses Datastore on Google Cloud Platform (GCP). Create a new project on GCP and enabble Datastore in the project. Install the gcloud CLI and run gcloud init to initialise it with your project.

OS Requirements

Ubuntu

apt-get install poppler-utils libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info

macOS

brew install libxml2 libxslt poppler cairo pango gdk-pixbuf libffi

Setup Virtual Environment

Create a virtual environment with the following command:

virtualenv venv
source venv/bin/activate

Bot Requirements

Run the following command to install the required packages:

pip install -r requirements.txt

Compile the translation files

Run the following command to compile all the translation files:

pybabel compile -D pdf_bot -d locale/

Setup Your Environment Variables

Copy the .env example file and edit the variables within the file:

cp .env.example .env

Running The Bot

You can then start the bot with the following command:

python bot.py

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages