manga2pdf


Namemanga2pdf JSON
Version 0.3.1 PyPI version JSON
download
home_pageNone
SummaryConvert manga/comic files(zip, epub, etc.) or directory containing image files (jpg, png, etc.) to PDF.
upload_time2025-08-05 16:22:41
maintainerNone
docs_urlNone
authormashu3
requires_python>=3.7
licenseMIT
keywords manga comic pdf converter
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # manga2pdf
[![License: MIT](https://img.shields.io/pypi/l/manga2pdf)](https://opensource.org/licenses/MIT)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/manga2pdf)](https://pypi.org/project/manga2pdf)
[![GitHub Release](https://img.shields.io/github/release/mashu3/manga2pdf?color=orange)](https://github.com/mashu3/manga2pdf/releases)
[![PyPi Version](https://img.shields.io/pypi/v/manga2pdf?color=yellow)](https://pypi.org/project/manga2pdf/)
[![Downloads](https://static.pepy.tech/badge/manga2pdf)](https://pepy.tech/project/manga2pdf)

## 📖 Overview
This Python script is specifically designed to convert manga and comic files, including various formats such as zip, epub, and directories containing image files, to PDF format.

The resulting PDF files are optimized to resemble Japanese manga in terms of page layout and direction. By default, the script uses a "TwoPageRight" page layout that displays two pages side-by-side for a spread view, and a "R2L" (right-to-left) reading direction that is commonly used in Japanese manga.

## 🔧 Requirements
The script uses the Python libraries **[img2pdf](https://pypi.org/project/img2pdf/)** and **[pikepdf](https://pypi.org/project/pikepdf/)** to do the conversion.
Moreover, it uses **[lxml](https://pypi.org/project/lxml/)** to read the EPUB files, **[rarfile](https://pypi.org/project/rarfile/)** to read the RAR archive files, **[py7zr](https://pypi.org/project/py7zr/)** to read `.7z` and `.cb7` archive files, **[numpy](https://pypi.org/project/numpy/)** for image processing, **[Pillow](https://pypi.org/project/Pillow/)** for image manipulation, **[i18nice[YAML]](https://pypi.org/project/i18nice/)** for internationalization, and **[tkface](https://github.com/mashu3/tkface)** for enhanced GUI features.

It requires the installation of these packages in order to work properly.

## 📜 Third-party Licenses
This project uses the following third-party libraries:
- **[py7zr](https://pypi.org/project/py7zr/)** - GNU Lesser General Public License v2.1
- **[img2pdf](https://pypi.org/project/img2pdf/)** - Apache License 2.0
- **[pikepdf](https://pypi.org/project/pikepdf/)** - Mozilla Public License 2.0
- **[lxml](https://pypi.org/project/lxml/)** - BSD License
- **[rarfile](https://pypi.org/project/rarfile/)** - ISC License
- **[numpy](https://pypi.org/project/numpy/)** - BSD License
- **[Pillow](https://pypi.org/project/Pillow/)** - HPND License
- **[i18nice](https://pypi.org/project/i18nice/)** - MIT License
- **[tkface](https://github.com/mashu3/tkface)** - MIT License

**⚠️ Important Notes**
- This script can only handle DRM-free fixed-layout EPUB files.
- Please ensure that the image files you input are named in numerical order according to their page sequence. For example, `page_01.jpg`, `page_02.jpg`, `page_03.jpg`, and so on, or `001.jpg`, `002.jpg`, `003.jpg`, and so on. This will ensure that the pages are converted and compiled in the correct order.

## 🚀 Usage
This script can take input in the form of `zip`, `cbz`, `rar`, `cbr`, `7z`, `cb7`, `tar`, `cbt`, `epub` files or directories containing images (`jpg`, `jpeg`, `png`, `gif`, `bmp`) of manga or comic pages.

The program can be executed from the command line with the following options:
- The `input_path` argument represents the path to the input file. To execute the Python script correctly, specify the `input_path` argument as the path to the input file containing manga or comic images in any of the supported formats, such as `zip`, `cbz`, `rar`, `cbr`, `7z`, `cb7`, `tar`, `cbt`, `epub`, or a directory containing images in formats such as `jpg`, `jpeg`, `png`, `gif`, or `bmp`.
- The `output_path` argument is the path to the output PDF file. To use the script, simply run the Python script with the path to the input file or directory as the argument. If the `--output` option is not specified, the output file name will be automatically generated based on the name of the input file or directory.
- The `pagelayout` parameter can take in the following values:
    - `SinglePage` -> Single page display
    - `OneColumn` -> Enable scrolling
    - `TwoPageLeft` -> Spread view
    - `TwoColumnLeft` -> Spread view with scrolling
    - (default) `TwoPageRight` -> Separate Cover, Spread View
    - `TwoColumnRight` -> Separate Cover, Scrolling Spread View
- The `pagemode` parameter can take in the following values:
    - (default) `UseNone` -> Neither document outline nor thumbnail images visible
    - `UseOutlines` -> Document outline visible
    - `UseThumbs` -> Thumbnail images visible
    - `FullScreen` -> Full-screen mode
    - `UseOC` -> Optional content group panel visible
    - `UseAttachments` -> Attachments panel visible
- The `direction` parameter can take in the following values:
    - `L2R` -> Left Binding
    - (default) `R2L` -> Right Binding

By default, the page layout is set to `TwoPageRight` and the reading direction to `R2L`, which are suitable for Japanese manga.

The `-j` or `--jpeg` option converts images to JPEG format before including them in the output PDF file, resulting in a smaller file size. Similarly, the `-g` or `--grayscale` option can be used to convert images to grayscale and reduce the size of the resulting PDF file. The program outputs the converted image in the specified format and compresses the PDF file accordingly.

The `--version` option displays the version information and exits.

**💭 Note**
- When the original image is already in the JPEG format, using the `-j` or `--jpeg` option will have no effect. Similarly, if the original image is already grayscale, using the `-g` or `--grayscale` option will have no effect. Also, if none of these options are used, the resulting PDF file will not be compressed.

There is a possibility that the script may not be able to handle files in unexpected formats correctly, which may result in errors or unexpected output.

## 📦 Installation
### Installing from PyPI
To install the latest version of the package from PyPI, run the following command:
```
$ pip install manga2pdf
```
### Installing directly from the Git repository
To install the package directly from the Git repository, run the following command:
```
$ pip install git+https://github.com/mashu3/manga2pdf.git
```
### Installing by cloning the Git repository
To install the package by cloning the Git repository, follow these steps:
```
$ git clone https://github.com/mashu3/manga2pdf.git
$ cd manga2pdf/
$ pip install .
```

**💭 Note**
- It is recommended to install the package from PyPI, but if you want to try out the latest changes, you can install it from the Git repository.
- This project uses `pyproject.toml` for package configuration, which is the modern standard for Python packaging.

## 🎯 Examples
- To convert `my_manga.zip` to `my_manga.pdf` using the default settings:
```
$ manga2pdf my_manga.zip
```
- To convert `my_manga.epub` to `my_manga_spread.pdf` with a spread view and right binding:
```
$ manga2pdf my_manga.epub -o my_manga_spread.pdf
```
- To convert `my_comic.epub` to `my_comic.pdf` with a TwoPage view and left binding:
```
$ manga2pdf my_comic.epub -o my_comic.pdf -p TwoPageLeft -d L2R
```

## 🖥️ GUI
To launch the graphical user interface:
```
$ manga2pdf -gui
``` 
The interface is available in multiple languages, including English, Japanese, German, Spanish, French, and Chinese (Simplified/Traditional). All settings that can be specified via the command line are available. Please note that translations other than English and Japanese are generated by AI.

The GUI uses **[tkface](https://github.com/mashu3/tkface)**, a Tkinter extension library developed specifically to address the limitations encountered while creating manga2pdf's GUI. This library provides:

- **Enhanced Date Selection**: Modern calendar widgets with multilingual support
- **Improved Message Boxes**: Centered dialogs with better styling
- **DPI Awareness**: Automatic scaling for high-resolution displays on Windows

The GUI is currently under development and additional features are planned for future updates.

## 👨‍💻 Author
[mashu3](https://github.com/mashu3)

[![Authors](https://contrib.rocks/image?repo=mashu3/manga2pdf)](https://github.com/mashu3/manga2pdf/graphs/contributors)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "manga2pdf",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "manga, comic, pdf, converter",
    "author": "mashu3",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/74/82/367efa7e628d9d91de94dcdc7cfae9bcde8f7459e270c4d2f30eb0088336/manga2pdf-0.3.1.tar.gz",
    "platform": null,
    "description": "# manga2pdf\n[![License: MIT](https://img.shields.io/pypi/l/manga2pdf)](https://opensource.org/licenses/MIT)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/manga2pdf)](https://pypi.org/project/manga2pdf)\n[![GitHub Release](https://img.shields.io/github/release/mashu3/manga2pdf?color=orange)](https://github.com/mashu3/manga2pdf/releases)\n[![PyPi Version](https://img.shields.io/pypi/v/manga2pdf?color=yellow)](https://pypi.org/project/manga2pdf/)\n[![Downloads](https://static.pepy.tech/badge/manga2pdf)](https://pepy.tech/project/manga2pdf)\n\n## \ud83d\udcd6 Overview\nThis Python script is specifically designed to convert manga and comic files, including various formats such as zip, epub, and directories containing image files, to PDF format.\n\nThe resulting PDF files are optimized to resemble Japanese manga in terms of page layout and direction. By default, the script uses a \"TwoPageRight\" page layout that displays two pages side-by-side for a spread view, and a \"R2L\" (right-to-left) reading direction that is commonly used in Japanese manga.\n\n## \ud83d\udd27 Requirements\nThe script uses the Python libraries **[img2pdf](https://pypi.org/project/img2pdf/)** and **[pikepdf](https://pypi.org/project/pikepdf/)** to do the conversion.\nMoreover, it uses **[lxml](https://pypi.org/project/lxml/)** to read the EPUB files, **[rarfile](https://pypi.org/project/rarfile/)** to read the RAR archive files, **[py7zr](https://pypi.org/project/py7zr/)** to read `.7z` and `.cb7` archive files, **[numpy](https://pypi.org/project/numpy/)** for image processing, **[Pillow](https://pypi.org/project/Pillow/)** for image manipulation, **[i18nice[YAML]](https://pypi.org/project/i18nice/)** for internationalization, and **[tkface](https://github.com/mashu3/tkface)** for enhanced GUI features.\n\nIt requires the installation of these packages in order to work properly.\n\n## \ud83d\udcdc Third-party Licenses\nThis project uses the following third-party libraries:\n- **[py7zr](https://pypi.org/project/py7zr/)** - GNU Lesser General Public License v2.1\n- **[img2pdf](https://pypi.org/project/img2pdf/)** - Apache License 2.0\n- **[pikepdf](https://pypi.org/project/pikepdf/)** - Mozilla Public License 2.0\n- **[lxml](https://pypi.org/project/lxml/)** - BSD License\n- **[rarfile](https://pypi.org/project/rarfile/)** - ISC License\n- **[numpy](https://pypi.org/project/numpy/)** - BSD License\n- **[Pillow](https://pypi.org/project/Pillow/)** - HPND License\n- **[i18nice](https://pypi.org/project/i18nice/)** - MIT License\n- **[tkface](https://github.com/mashu3/tkface)** - MIT License\n\n**\u26a0\ufe0f Important Notes**\n- This script can only handle DRM-free fixed-layout EPUB files.\n- Please ensure that the image files you input are named in numerical order according to their page sequence. For example, `page_01.jpg`, `page_02.jpg`, `page_03.jpg`, and so on, or `001.jpg`, `002.jpg`, `003.jpg`, and so on. This will ensure that the pages are converted and compiled in the correct order.\n\n## \ud83d\ude80 Usage\nThis script can take input in the form of `zip`, `cbz`, `rar`, `cbr`, `7z`, `cb7`, `tar`, `cbt`, `epub` files or directories containing images (`jpg`, `jpeg`, `png`, `gif`, `bmp`) of manga or comic pages.\n\nThe program can be executed from the command line with the following options:\n- The `input_path` argument represents the path to the input file. To execute the Python script correctly, specify the `input_path` argument as the path to the input file containing manga or comic images in any of the supported formats, such as `zip`, `cbz`, `rar`, `cbr`, `7z`, `cb7`, `tar`, `cbt`, `epub`, or a directory containing images in formats such as `jpg`, `jpeg`, `png`, `gif`, or `bmp`.\n- The `output_path` argument is the path to the output PDF file. To use the script, simply run the Python script with the path to the input file or directory as the argument. If the `--output` option is not specified, the output file name will be automatically generated based on the name of the input file or directory.\n- The `pagelayout` parameter can take in the following values:\n    - `SinglePage` -> Single page display\n    - `OneColumn` -> Enable scrolling\n    - `TwoPageLeft` -> Spread view\n    - `TwoColumnLeft` -> Spread view with scrolling\n    - (default) `TwoPageRight` -> Separate Cover, Spread View\n    - `TwoColumnRight` -> Separate Cover, Scrolling Spread View\n- The `pagemode` parameter can take in the following values:\n    - (default) `UseNone` -> Neither document outline nor thumbnail images visible\n    - `UseOutlines` -> Document outline visible\n    - `UseThumbs` -> Thumbnail images visible\n    - `FullScreen` -> Full-screen mode\n    - `UseOC` -> Optional content group panel visible\n    - `UseAttachments` -> Attachments panel visible\n- The `direction` parameter can take in the following values:\n    - `L2R` -> Left Binding\n    - (default) `R2L` -> Right Binding\n\nBy default, the page layout is set to `TwoPageRight` and the reading direction to `R2L`, which are suitable for Japanese manga.\n\nThe `-j` or `--jpeg` option converts images to JPEG format before including them in the output PDF file, resulting in a smaller file size. Similarly, the `-g` or `--grayscale` option can be used to convert images to grayscale and reduce the size of the resulting PDF file. The program outputs the converted image in the specified format and compresses the PDF file accordingly.\n\nThe `--version` option displays the version information and exits.\n\n**\ud83d\udcad Note**\n- When the original image is already in the JPEG format, using the `-j` or `--jpeg` option will have no effect. Similarly, if the original image is already grayscale, using the `-g` or `--grayscale` option will have no effect. Also, if none of these options are used, the resulting PDF file will not be compressed.\n\nThere is a possibility that the script may not be able to handle files in unexpected formats correctly, which may result in errors or unexpected output.\n\n## \ud83d\udce6 Installation\n### Installing from PyPI\nTo install the latest version of the package from PyPI, run the following command:\n```\n$ pip install manga2pdf\n```\n### Installing directly from the Git repository\nTo install the package directly from the Git repository, run the following command:\n```\n$ pip install git+https://github.com/mashu3/manga2pdf.git\n```\n### Installing by cloning the Git repository\nTo install the package by cloning the Git repository, follow these steps:\n```\n$ git clone https://github.com/mashu3/manga2pdf.git\n$ cd manga2pdf/\n$ pip install .\n```\n\n**\ud83d\udcad Note**\n- It is recommended to install the package from PyPI, but if you want to try out the latest changes, you can install it from the Git repository.\n- This project uses `pyproject.toml` for package configuration, which is the modern standard for Python packaging.\n\n## \ud83c\udfaf Examples\n- To convert `my_manga.zip` to `my_manga.pdf` using the default settings:\n```\n$ manga2pdf my_manga.zip\n```\n- To convert `my_manga.epub` to `my_manga_spread.pdf` with a spread view and right binding:\n```\n$ manga2pdf my_manga.epub -o my_manga_spread.pdf\n```\n- To convert `my_comic.epub` to `my_comic.pdf` with a TwoPage view and left binding:\n```\n$ manga2pdf my_comic.epub -o my_comic.pdf -p TwoPageLeft -d L2R\n```\n\n## \ud83d\udda5\ufe0f GUI\nTo launch the graphical user interface:\n```\n$ manga2pdf -gui\n``` \nThe interface is available in multiple languages, including English, Japanese, German, Spanish, French, and Chinese (Simplified/Traditional). All settings that can be specified via the command line are available. Please note that translations other than English and Japanese are generated by AI.\n\nThe GUI uses **[tkface](https://github.com/mashu3/tkface)**, a Tkinter extension library developed specifically to address the limitations encountered while creating manga2pdf's GUI. This library provides:\n\n- **Enhanced Date Selection**: Modern calendar widgets with multilingual support\n- **Improved Message Boxes**: Centered dialogs with better styling\n- **DPI Awareness**: Automatic scaling for high-resolution displays on Windows\n\nThe GUI is currently under development and additional features are planned for future updates.\n\n## \ud83d\udc68\u200d\ud83d\udcbb Author\n[mashu3](https://github.com/mashu3)\n\n[![Authors](https://contrib.rocks/image?repo=mashu3/manga2pdf)](https://github.com/mashu3/manga2pdf/graphs/contributors)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Convert manga/comic files(zip, epub, etc.) or directory containing image files (jpg, png, etc.) to PDF.",
    "version": "0.3.1",
    "project_urls": {
        "Homepage": "https://github.com/mashu3/manga2pdf"
    },
    "split_keywords": [
        "manga",
        " comic",
        " pdf",
        " converter"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6724a52801a428e1a11f41e33c112b5ac5f62afa1bc95045ea25bd1b609efb4e",
                "md5": "cb4ee2a4c797f7363d56b586c93dec08",
                "sha256": "bc37c8e088563811c7f36cedd0b9b6961a4b55e879db15a76d08b2dec6cf4f89"
            },
            "downloads": -1,
            "filename": "manga2pdf-0.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cb4ee2a4c797f7363d56b586c93dec08",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 28116,
            "upload_time": "2025-08-05T16:22:40",
            "upload_time_iso_8601": "2025-08-05T16:22:40.610601Z",
            "url": "https://files.pythonhosted.org/packages/67/24/a52801a428e1a11f41e33c112b5ac5f62afa1bc95045ea25bd1b609efb4e/manga2pdf-0.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7482367efa7e628d9d91de94dcdc7cfae9bcde8f7459e270c4d2f30eb0088336",
                "md5": "407c39f043327b781888550d5297b84e",
                "sha256": "4b32d7836c51f036658f49351b9ca8c26a6a5ebc05d4bc50bef072a17f28f68c"
            },
            "downloads": -1,
            "filename": "manga2pdf-0.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "407c39f043327b781888550d5297b84e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 25155,
            "upload_time": "2025-08-05T16:22:41",
            "upload_time_iso_8601": "2025-08-05T16:22:41.634688Z",
            "url": "https://files.pythonhosted.org/packages/74/82/367efa7e628d9d91de94dcdc7cfae9bcde8f7459e270c4d2f30eb0088336/manga2pdf-0.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-05 16:22:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mashu3",
    "github_project": "manga2pdf",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "manga2pdf"
}
        
Elapsed time: 0.39262s