Repository navigation
Releases
Scriptorium EPUB 1.4.0
Text size now means the same in every book, and epub_diff.py compares whole folders of books. pdf2epub.py writes matrices and triple primes as real formulas. Python 3.11 or newer is now needed.
Library and reader
- One text size for every book. Some books make all their text smaller or larger themselves (
p { font-size: 80% }), so the same size used to look different from book to book. The reader now works out the size of a book's main text and evens it out. Footnotes, quotes and headings keep the book's proportions; books set in pixels are left as they are. It is worked out once per book on each device, while its pages are counted.
PDF → EPUB
- Matrices with an index (
\begin{pmatrix}…\end{pmatrix}_{3\times5}) come out as one formula: the numbers are no longer small and the brackets no longer short. - Three or more primes (
f''') no longer leave the formula as LaTeX. - A busy processor only makes reading slower: a page is no longer read a second time, worse, when other work holds the processor up.
epub_diff.py
- No file names needed: put the older version in
Diff/Old, the newer inDiff/Newand runpython3 epub_diff.py. Several books are paired by file name. Each report is also written toDiff/<book name>.html. - Shows both file sizes and, when the files differ but the book doesn't, why (pages written differently with the same words, the archive recompressed).
- The HTML report names its Old and New columns and keeps the heading at the top while a long table scrolls.
Other
- Python 3.11 or newer is required.
fix_cover.pysays the archive is recompressed and only the file contents stay the same.
Updating
Run make_server.py on your library again. This rebuilds the catalog and copies the new reader into the library. See the README.
Scriptorium EPUB 1.3.0
Books go into folders straight from the catalog, as easily as into Favorites.
Library
- A folder button under every cover, next to the star. It opens the same Folders box as the book's page: tick a folder to put the book in, untick to take it out, or make a new folder there. The book's page doesn't have to be opened.
- On a computer the box opens under the button. A click on another card's button moves it there. Esc or a click elsewhere closes it.
- On a phone it is a sheet from the bottom, and Back closes it.
- Inside an open folder, a book you untick leaves the list at once, and the box stays open for the next one.
- An empty folder now points to this button.
- In a narrow card (a phone, or a tight column on a computer, when Share is shown) the buttons sit closer together and Read shows only its icon, so all of them fit.
Updating
Run make_server.py on your library again to rebuild the catalog. See the README.
Scriptorium EPUB 1.2.0
The library now shows PDFs too. A PDF next to an EPUB of the same name is the same book in a second format, and a PDF on its own gets a card of its own. pdf2epub.py reads scans 2.6 times faster on the processor, and it keeps more of what is on the page: vector arrows, lines to write on, title pages and parts of the contents.
Library and reader
- EPUB and PDF in one place. A PDF in the same folder and with the same name as an EPUB (
Jane Doe - A Quiet Harbour.epub+.pdf) joins that book: one card, read in EPUB. Small EPUB and PDF labels on every card and on the book's page show which formats are there. - Opening a PDF. A click on PDF opens it in a new tab, in the browser's own viewer. The right button's Save link as… saves it. EPUB is saved as before.
- A PDF on its own gets a card too. Its first page is the cover, and its author and title come from an
Author - Titlefile name. It has Open PDF in place of Read. - ZIP of a folder holds both files of a book.
- The offline app keeps only EPUBs on the device.
- The reader builds a book's page positions about 6 times faster. The positions stay the same, so your places in your books don't move.
PDF → EPUB
- 2.6 times faster on the processor, with the same text. On 8 scanned pages it took 246 s instead of 632 s.
- Vector arrows that the model read as bars or tildes are put back, also in subscripts and small italics.
- Lines to write on in workbooks ("for notes", room for an answer) are kept as empty lines in quick mode too.
- Contents with spaced dot leaders (". . .") become one list of links. Part titles between chapters are entries of their own.
- Title pages and dedications are centred, each on a page of its own.
- A figure cut in two by the layout is cut out of the page whole.
- Recognition loops are cut out instead of reading the whole page again.
- Fixes:
- No junk from a box set beside the text, from a formula after a subscript, or from the model's descriptions of pictures.
- The progress line names the pages read (
164–165, 443–444), not just the first and the last.
New tool
epub_diff.pyshows what changed between two versions of a book, page by page: recognition garbage, missing text, formulas, pictures and so on. Each change comes with its PDF page.--htmlwrites the report as a web page.
Updating
Run make_server.py on your library again. This rebuilds the catalog and copies the new launchers into the library. Install pdftoppm (poppler) if you want covers for PDFs that have no EPUB. See the README.
Scriptorium EPUB 1.1.0
New in the library: Favorites, sharing a book, and downloading a folder as one ZIP. pdf2epub.py now uses an NVIDIA graphics card when there is one, and it goes on after a stop or a power cut without losing pages.
Library and reader
- Favorites. A star under every cover, and on the book's page, puts the book in Favorites. Favorites is a folder that always comes first, and it can't be renamed or deleted. It syncs between your devices like your other folders.
- Share a book. A Share button on every book and on its page sends a link to that book. On a phone it opens the phone's share menu; on a computer it copies the link. Whoever opens the link and has an account lands on the book's page, even after signing in first, and can add the book to their own folders or Favorites. The button shows only on the library's https address.
- Download a folder as a ZIP. The open folder's ⋯ menu has Download as ZIP: all of the folder's books in one file, with exact progress. The ZIP is built on the fly while it downloads, so nothing is left on the server. This works with every launcher, the Windows ones included.
- Open file in the catalog shows the file dialog at once.
- In the reader, a press on the size number sets the text back to 100%, and the theme button comes first.
PDF → EPUB
- NVIDIA graphics cards. When a card is found, pages are read on it, about 1.4 times faster on a GTX 1050 Ti. Without a card, pages are read on the processor as before.
- Stops and power cuts. Run it again to go on from where it stopped. It asks no questions, and a page that comes back damaged is read again.
- The book's index at the end is put together from its columns in the right order.
- Fixes:
- Blank scanned pages are skipped instead of failing the batch.
- Aligned formulas no longer break the finished book.
- Book and work-folder names fit any file system.
Updating
Run make_server.py on your library again. This rebuilds the catalog and copies the new launchers into the library. See the README.
Scriptorium EPUB 1.0.0
The first release of Scriptorium EPUB: small Python scripts that turn PDFs into EPUB and keep an EPUB collection in order, plus a personal library server for every device at home.
What's inside
pdf2epub.py: PDF → EPUB with no compromise on quality. Every page is read from its picture by a free offline recognition engine and checked word by word against the PDF text layer. You get real paragraphs, joined hyphenation, bold and italic, headings, lists, tables, formulas, footnotes and the book's own table of contents. A stopped run goes on from the same page. Quick mode uses the text layer only.make_server.py: your own library server. It builds a catalog of any EPUB folder, with covers, search, sorting and a built-in reader. Double-clickOpen Library (network)and the library opens on your phone, tablet and laptop over home Wi-Fi. Accounts sync your reading place, bookmarks and folders across devices. You can install it like an app on a phone and read offline. Devices that are not signed in see only the sign-in page.epub_rename.pysorts books intoOut/Books/<Author>/<Author> - <Title>.epubusing the metadata inside each book, and verifies every copy.fix_cover.pymakes sure every book has a cover readers can find. It draws a missing one from the title and author, and repairs pages that strict readers can't open.
Requirements
- Python 3.10 or newer. Nothing else for the library tools.
pdf2epub.pyalso needs Poppler. The recognition engine installs itself on first run and currently works on Linux x86-64.- Pillow is optional, for smaller catalog covers and drawn covers.
See the README for the quick start.