Skip to content

Instantly share code, notes, and snippets.

@stefanschmidt
Created June 20, 2023 11:22
Show Gist options
  • Save stefanschmidt/63fdd9f86a35f14d86c02cc321b59ca7 to your computer and use it in GitHub Desktop.
Save stefanschmidt/63fdd9f86a35f14d86c02cc321b59ca7 to your computer and use it in GitHub Desktop.

Revisions

  1. stefanschmidt created this gist Jun 20, 2023.
    8 changes: 8 additions & 0 deletions fix-page-labels-pdf.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    # cover (1 page)
    # table of contents (14 pages)
    # result: C1,i,ii,...,xiv,1,2,...
    pip install pagelabels
    python -m pagelabels --delete doc.pdf
    python -m pagelabels --startpage 1 --prefix C doc.pdf
    python -m pagelabels --startpage 2 --type 'roman lowercase' doc.pdf
    python -m pagelabels --startpage 16 --type arabic doc.pdf