GithubHelp home page GithubHelp logo

unusaulwu / pdf2epub Goto Github PK

View Code? Open in Web Editor NEW

This project forked from julianbvw/pdf2epub

0.0 0.0 0.0 206 KB

Small Python script to convert a PDF to an EPUB file.

Python 1.08% Jupyter Notebook 98.92%

pdf2epub's Introduction

๐Ÿ“„ pdf2epub ๐Ÿ“–

CLI tool for converting a PDF to an EPUB file.


  • Do you want to read a book on your phone but only have the pdf which doesn't scale well?
  • Or maybe the book is just available as PDF and not as EPUB?

-> Use this script to convert the PDF to an EPUB which you can then import into your favorite reader.

Usage

Download the pdf2epub.py script and run it:

python pdf2epub.py <path/to/file.pdf> <title> <author> [flags]

The output will be saved as path/to/file.epub.

Example

python pdf2epub.py ./hp5.pdf Harry\ Potter\ 5 JK\ Rowling -f 7 -p 7 -r -\ [0-9]+\ -

Flags

Flag Shortcut Default Function
--cover N -c 1 The page of the cover image*.
--first N -f 2 The first page containing the content.
--image_scale N -s 4 Multiplier for image resolution.
--language LANG -l 'de' Configure eBook language setting.
--pagenumberstart N -p 0 The page where numbering startes (0 if no numbering).
--pagenumberredex REDEX -r '[0-9]+' The REDEX to match the numbering against.
--watermark REDEX -w '' The REDEX to match watermarks against ('' if no watermarks).

*If you want to use your own image, set this to 0 and paste the image into './tmp/img-cover.jpeg'.

Requirements

Requirement Version
Python 3
ebooklib 0.17.1+
pymupdf 1.20.1+

pdf2epub's People

Contributors

julianbvw 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.