Giter Site home page Giter Site logo

rikbon / pdf2cbz Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 7 KB

Transform your PDFs into CBZ archives with ease, making digital reading a breeze. Perfect for comic lovers and archivists, pdf2cbz offers seamless conversion with optional image compression for quality and efficiency.

License: MIT License

Python 100.00%

pdf2cbz's Introduction

pdf2cbz

Convert PDF files to CBZ (Comic Book Zip) format with ease, leveraging the power of Python. This tool provides a seamless way to transform your PDFs into CBZ archives, ideal for comic book enthusiasts and digital archivists alike.

Features

  • Convert PDF to CBZ archive.
  • Option to use WebP for image compression, offering high-quality images at smaller file sizes.
  • Customizable image quality settings.

Prerequisites

  • Python 3.6 or higher
  • pip (Python package installer)

Installation

Using Conda

If you prefer using Conda, follow these steps to create a new environment and install the required dependencies:

  1. Create a new Conda environment:
    conda create --name pdf2cbz python=3.8
  2. Activate the environment:
    conda activate pdf2cbz
  3. Install the dependencies:
    conda install -c conda-forge pymupdf pillow

Using Python's Virtual Environment

For those who prefer Python's virtual environment, follow these steps:

  1. Create a virtual environment:
    python3 -m venv pdf2cbz-env
  2. Activate the environment: For Windows:
    pdf2cbz-env\Scripts\activate
    For Unix or MacOS:
    source pdf2cbz-env/bin/activate
  3. Install the dependencies from requirements.txt:
    pip install -r requirements.txt

Usage

To convert a PDF to CBZ format, run the pdf2cbz.py script with the following command:

python pdf2cbz.py --input <path_to_pdf> --output <path_to_cbz> --format <image_format> --quality <quality>
  • <path_to_pdf>: Path to the source PDF file.
  • <path_to_cbz>: Path to the output CBZ file.
  • <image_format>: (Optional) Image format for compression. Choose between 'png' and 'webp'. Default is 'webp'.
  • <quality>: (Optional) Quality of the compressed images. Default is 80.

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue.

pdf2cbz's People

Contributors

rikbon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.