Skip to main content

Add Table of Content in scanned German old-style Textbooks

Project description

Oldstyle PDF ToC

Install

pip install oldstyle-pdf-toc

Usage

1. Create the toc.txt

The file must be nammed toc.txt

# Lines that begin with # are ignored, empty lines are alis ignored

# Set page number to Uppercase roman number (I, II, III, ...)
\pageLabel{1}{1}{UppercaseRomanNumerals}

# Copy origin ToC of the book

Schrifttum 11

# Change page number from to decimal arabic number, reset it to 1 but physical page numer is now 13
\pageLabel{13}{1}{DecimalArabicNumerals}

# Copy other parts of the ToC of the Book

I. Abbildungsverfahren 1
1. Aufgabe der Darstellenden Geometrie 1
2. Zentralprojektion 4
3. Parallelprojektion 6

II. Parallelprojektion und perspektive Affinität 8
4. Invarianten der Parallelprojektion 8
5. Der Satz von DESARGUES 11
6. Perspektive Affinität 12
7. Analytische Darstellung einer ebenen perspektiven Affinität 14
8. Das Rechtwinkelpaar einer ebenen perspektiven Affinität 17
9. Die Ellipse als affines Bild des Kreises 19
10. Affine Eigenschaften der Ellipse 21
11. Ellipsenkonstruktionen 23

# .... others entries
Namen- und Sachverzeichnis 339

The complete example toc.txt can be found in this project repository.

2. Call the python script

oldstyle-pdf-toc > pdftk.toc.txt

3. Call the pdftk

pdftk Strubecker.pdf update_info_utf8 pdftk.toc.txt output Strubecker.pdf-toc.pdf

That's it!

Development

This Project uses uv to manage dependencies and tasks during development and deployment

uv python install               # Install a copy of python to this directory
uv venv                         # Creat a virtual python environment
source .venv/bin/activate       # Activate venv
uv pip install -e .             # Install this project as a python package into the virtual environment
uv build

Deploy in PyPi

See: https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#create-an-account

Prinzipial:

uv build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oldstyle_pdf_toc-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oldstyle_pdf_toc-0.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file oldstyle_pdf_toc-0.1.0.tar.gz.

File metadata

  • Download URL: oldstyle_pdf_toc-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for oldstyle_pdf_toc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 69d0645c9c8a2d9ca08effb6b6af900ebde485511baea27e2e4b94b5b8e2f197
MD5 ab10d40892e5f2e5626f97d6e0b156cc
BLAKE2b-256 47e859dc623cc1f2dab54dc6479bd16249ead5a0d39603e891b8de4a1abbc0b4

See more details on using hashes here.

File details

Details for the file oldstyle_pdf_toc-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for oldstyle_pdf_toc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 931125f28cd7c49f3468156e89ae4cd186c2926997e88cf4db03874eff1ea6f2
MD5 abbae83290a4ba2c649eab312db1e5da
BLAKE2b-256 392509c2336b28f26dc297d248e69ab1e5a7620e7f4b1be29e45d39127abd72b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page