Free Python script

Screenplay PDF to EPUB

A small tool for film composers that turns a screenplay PDF into a clean, reflowable EPUB, so scripts are comfortable to read on e-readers such as Tolino or Kindle. It runs on your own computer; nothing is uploaded.

  • Python 3
  • Open source (AGPL-3.0)
  • Runs locally

Screenplays arrive as PDFs laid out for paper. On an e-reader they are tiny, the pages don't reflow, and you pinch and scroll all the time. This script converts a screenplay PDF into an EPUB that reflows to your screen: scene headings become chapters, so you can jump from scene to scene, and dialogue and action are set so they read well on a small display.

Personal use only

Screenplays are often sent with the recipient's name stamped diagonally across every page. That watermark protects the author's and the production company's work. The tool hides the diagonal watermark only so the text is readable on a small screen, and it puts the name back as a plain footer so the copy stays attributable to you.

  • Do not pass on, upload or publish the converted EPUB.
  • Do not use the tool to hide who a document was issued to.
  • If a client or production company gave you the PDF, honour the terms that came with it.

How to use it

Download the repository from GitHub (the green "Code" button, then "Download ZIP") or clone it. Everything the tool needs, including its virtual environment, stays inside that folder. The first run installs the one dependency, PyMuPDF, so it needs an internet connection once.

cp .env.example .env
./run.sh src/convert.py /path/to/screenplay.pdf

The EPUB is written to the output/ folder. Optional settings live in the .env file: for example the watermark text (otherwise it is detected automatically), extra lines to drop, whether to remove page numbers, and the title and author for the book. Names and paths of your own documents stay in .env only, which is not part of the repository.

Then copy the EPUB to your Tolino, or send it to your Kindle with Amazon's Send to Kindle.

Limits

  • Tuned for German-format screenplays. The tool reads the layout by the position of the text on the page, and these positions are tuned to one standard screenplay layout. Other layouts may need some adjustment.
  • The labels in the EPUB (title, table of contents) are in German, and the author is taken from the line after "von" on the title page.
  • Scene headings are recognised by INT/EXT.
  • It can only remove a watermark it can detect, or one you name in .env.

The full documentation, the changelog and the source are in the GitHub repository. The licence is AGPL-3.0-or-later, the same as PyMuPDF.