Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.
/ merge-pdf Public archive

Combines PDF, CBR and CBZ files into a single PDF document

License

Notifications You must be signed in to change notification settings

xfnty/merge-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTE

The memory management is terrible. So simply use pdfunite instead.


Simple script for combining PDFs and CBRs into a single document. Originally was created to merge manga chapters from ReadmangaGrabber and HakuNeko.

Install

On Linux

chmod +x ./scripts/install.sh && ./scripts/install.sh

Requirements

On Linux

chmod +x ./scripts/setup.sh && ./scripts/setup.sh

On Windows

python -m venv .venv
venv\Scripts\activate
pip install -r requirements.txt

Usage

usage: merge-pdf [-h] [-d] input_folder output_filename

Combines PDFs or comic books into a single PDF document

positional arguments:
  input_folder     Folder in which to search for chapter files.
  output_filename  Output filename. Supported formats are "pdf", "png", "cbr", "cbz".

optional arguments:
  -h, --help       show this help message and exit
  -d, --dry-run    Do not make actual changes.

Sample output

main@hp-laptop:~/Documents/merge-pdf$ merge-pdf -d ./test/ ./test/out.pdf
+ ./test/1/1.pdf (4.1 MB) 4.1 MB in total
+ ./test/1/2.pdf (2.0 MB) 6.1 MB in total
+ ./test/2/1.pdf (2.8 MB) 8.9 MB in total
+ ./test/2/2.pdf (2.9 MB) 11.8 MB in total
Merging files... (dry run) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:06
Total size: 802.9 MB

Notes

Often cache grows too big. Clear it with this command:

sudo sh -c 'echo 1 >  /proc/sys/vm/drop_caches'

About

Combines PDF, CBR and CBZ files into a single PDF document

Topics

Resources

License

Stars

Watchers

Forks