百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

pystitcher

> 编程语言
开源

pystitcher 会将您的 PDF 文件拼接在一起,使用声明性 Markdown 文件作为输入,为您生成可自定义的书签

396 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

pystitcher 会将您的 PDF 文件拼接在一起,使用声明性 Markdown 文件作为输入,为您生成可自定义的书签

pystitcher

pystitcher stitches your PDF files together, generating nice customizable bookmarks for you using a declarative input in the form of a markdown file. It is written in pure python and uses pypdf for reading and writing PDF files.

Installation

You can install it easily using pipx:

pipx install pystitcher

The Wiki has Alternative Installation Instructions.

Description

pystitcher is a command line tool, with very few cli options:

usage: pystitcher [-h] [--version] [-v] [--cleanup | --no-cleanup] spine.md output.pdf

Stitch PDF files together

positional arguments:
  spine.md              Input markdown file
  output.pdf            Output PDF file

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -v, --verbose         log more things
  --cleanup, --no-cleanup
                        Delete temporary files (default: True)

Given this input:

…

Will generate a PDF with proper bookmarks:

And the correct metadata:

yaml
Title:          Complete Guide to the Personal Data Protection Bill
Subject:        Personal Data Protection Bill
Keywords:       privacy, surveillance, personal data protection
Author:         Medianama
Creator:        pystitcher/1.0.0
Producer:       pystitcher/1.0.0

Configuration options can be specified with Meta data at the top of the file.

  • fit: Default fit of the bookmark. Can be overwritten per bookmark See wiki for more details.
  • author: PDF Author
  • keywords: PDF Keywords
  • subject: PDF Subject
  • title: PDF Title. If left unspecified, first Heading (h1) in the document is used.
  • existing_bookmarks: What to do with existing bookmarks in individual files. Options are keep, flatten, and remove. See[docs] (https://github.com/captn3m0/pystitcher/wiki/Existing-Bookmarks) for more details.

Additionally, PDF links specified in markdown can have attributes to alter the PDFs before merging. The below attribute will rotate the second PDF file by 90 degrees clockwise before merging:

[Part 1](1.pdf)
[Part 2](2.pdf){: rotate="90"}

And the below attribute will merge only pages 2 to 5, both inclusive, from the second PDF file:

[Part 1](1.pdf)
[Part 2](2.pdf){: start=2 end=5}

The list of available attributes are:

Attribute Notes
rotate Rotate the PDF. Valid values are 90, 180, 270
start Start page number for PDF page selection
end End page number for PDF page selection

Documentation

Additional documentation is maintained on the project wiki on GitHub.

Issues· 8 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythonpdf-bookmarkerpdf-generationpdfmergepython-pdf

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言