Skip to content

feat: multi-manuscript PDF merge #129

@nikazzio

Description

@nikazzio

Summary

Allow merging multiple manuscripts (or selected pages from different manuscripts) into a single PDF document.

Motivation

Scholars often need to assemble fragments of a text that are scattered across multiple manuscripts or libraries into a single reading copy. Today they must export each manuscript separately and merge manually.

Proposed approach

  • Add a "Merge PDFs" action in Library (select N manuscripts → merge).
  • Allow page range selection per manuscript (e.g., ms A pages 1-10 + ms B pages 50-60).
  • Reuse existing PDF export infrastructure for individual page rendering.
  • Add a table of contents / bookmarks separating each manuscript section.
  • Output as a single downloadable PDF.

Acceptance criteria

  • Multi-select manuscripts in Library → "Merge to PDF" action
  • Optional page range selection per manuscript
  • Merged PDF has bookmarks/TOC for each section
  • Page numbering is continuous
  • Works with manuscripts that have different page sizes
  • Progress indicator for large merges

Technical notes

  • Use pypdf (already a dependency via PDF export) for merging.
  • Alternatively, generate pages via the existing PDF pipeline and concatenate.
  • Consider memory: stream pages to disk rather than holding all in RAM.
  • Add a max_merge_pages config setting to prevent OOM on huge requests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:exportExport pipeline and jobsminorIncrements the minor version when adding new functionality in a backward-compatible manner.priority:P2Medium prioritystatus:readyReady to be implementedtype:featureNew user-facing feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions