Convert fixed-layout manga/comic files(epub, azw3, mobi) to PDF file.
Project description
epub2pdf
Overview
This is a Python script for converting fixed-layout EPUB/MOBI files such as comics and manga to PDF file, which can be executed from the command line with some arguments. This Python script only supports DRM-free EPUB/MOBI files of a specific format.
Requirement
The script uses the Python libraries img2pdf and pikepdf to do the conversion. Moreover, it uses lxml to read the EPUB files and mobi to handle both MOBI and AZW files.
It requires the installation of these packages in order to work properly.
Usage
The program can be executed from the command line with the following options:
- The
input_pathargument is the path to the input file. To execute the Python script correctly, specify theinput_pathargument as the path to the input file containing manga or comic images in one of the supported formats, such asepub,mobi, orazw. - The
output_pathargument is the path to the output PDF file. To use the script, simply run the Python script with the path to the input EPUB file as the argument. If the--outputoption is not specified, the output file name will be generated from the input EPUB file name. - The
pagelayoutargument is the page layout of the PDF file. Thepagelayoutparameter can take in the following values:SinglePage-> Single page displayOneColumn-> Enable scrollingTwoPageLeft-> Spread viewTwoColumnLeft-> Spread view with scrolling- (default)
TwoPageRight-> Separate Cover, Spread View TwoColumnRight-> Separate Cover, Scrolling Spread View
- The
directionargument is the reading direction of the PDF file. Thedirectionparameter 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.
There is a possibility that the script will not run correctly if an unexpected EPUB format is encountered, as the script may not be able to handle it correctly.
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/epub2pdf.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/epub2pdf.git
$ cd epub2pdf/
$ pip install .
Examples
-
To convert
my_manga.epubtomy_manga.pdfusing the default settings:$ python epub2pdf.py my_manga.epub -
To convert
my_manga.epubtomy_manga_spread.pdfwith a spread view and right binding:$ python epub2pdf.py my_manga.epub -o my_manga_spread.pdf -
To convert
my_comic.epubtomy_comic.pdfwith a TwoPage view and left binding:$ python epub2pdf.py my_comic.epub -o my_comic.pdf -p TwoPageLeft -d L2R
Once the arguments are given, the program will convert the EPUB file to PDF.
Credits
Author
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file epub2pdf-0.1.0.tar.gz.
File metadata
- Download URL: epub2pdf-0.1.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc6565fd1fea8d70594cdbea78ed1bd5312f02fb8878e21b0a937f3ca6ea65cd
|
|
| MD5 |
a90774b1ffb37c7c293f88f0e0b40097
|
|
| BLAKE2b-256 |
bd9b3ed4117e3bcc0f48d8bf38e466608e405ba36d16e4b53d2488bdd0a7563b
|
File details
Details for the file epub2pdf-0.1.0-py3-none-any.whl.
File metadata
- Download URL: epub2pdf-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
363d82750a803d7a1c700d8f21cc832f4810f1e0b0111318c947ff47bbb4c1f6
|
|
| MD5 |
dea3411a81436ef4db40b15707b9845d
|
|
| BLAKE2b-256 |
f6ef91ee9993c25a9edcdb86cf240a70b9b533c362f8d983f421183743c5eefa
|