Imprint PDF

io.github.263311487-uxPublished by GitHub account 263311487-uxv0.14.0Updated Oct 25, 2026

AI-native print-grade PDF generator. Markdown in, publisher-quality PDF out.

VerifiedSTDIODesktop onlyFiles & StorageMedia & Design

Overview

AI-generated overview

Imprint PDF turns Markdown into print-quality PDFs with Chinese typography, themes and a 0–100 quality report, exposed to assistants as MCP tools.

What you can do
  • Render Markdown into a typeset PDF with cover, table of contents, themes and Chinese typographic rules
  • List the available themes and create new documents from built-in templates (report, book, resume, tech doc, letter, two-column paper, IEEE, official-document style)
  • Validate a generated PDF and return a 0–100 print-quality score with per-item evidence
  • Apply automatic theme selection, image compression, Mermaid diagrams, math formulas and code highlighting during rendering
When to use it
Useful when an assistant should produce a finished, publisher-style PDF from Markdown drafts — papers, reports, resumes, letters or Chinese documents — and wants an automated check of the output's typography and accessibility markers.
Requirements
Runs locally over stdio as a Python package (imprint-pdf, Python 3.10+), with the MCP extra installed and started via the imprint-mcp command. Needs WeasyPrint's native Pango/GLib libraries, and Chinese fonts must be installed by the user. No accounts, keys or headers are declared.
Before you install
The quality score is a repeatable heuristic check, not a print-shop certification, and the Tagged PDF check does not equal full PDF/UA compliance. The README warns that its online demo sends submitted Markdown to a temporary hosted server, so private documents should be rendered locally. Source, PyPI and npm versions may differ.

Installation

In SourceWeft

  1. Open Imprint PDF in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

Imprint · 印记

Markdown 进,出版社级 PDF 出,自带 0–100 印刷级质检报告。

[Imprint · 印记 — Markdown 进,出版社级 PDF 出]

English · 简体中文 · 在线画廊与演示 · 本地生成指南

Imprint 是一个 AI 原生的中文印刷级 PDF 生成器。它把 Markdown 当成草稿,把 PDF 当成成品——按出版物的标准排版:宋体正文、黑体标题、首行缩进、标点避头尾、目录页码精确、表格跨页重复表头、代码不截断。生成之后,机器自动给这份 PDF 打分:0–100 印刷级评分,逐项给出证据。

[PyPI] [npm] [Python] [License] [Downloads] [CI] [Stars]

在线演示可用性有限。 提交的 Markdown 会发送到临时托管服务器进行渲染;请勿上传私密或敏感文档。需要处理私密内容时,请按本地生成指南在本机运行。

快速开始(需先准备平台依赖)

bash
# 方式一:npm 包装器(首次可能联网安装 Python 引擎)npx imprint-pdf 论文.md
# 方式二:pip 安装(已发布到 PyPI)pip install imprint-pdfimprint 论文.md
# 常用命令npx imprint-pdf --new report     # 从模板起稿npx imprint-pdf --list-themes    # 24 套主题npx imprint-pdf 论文.md --theme academic --out 论文.pdf

首次成功与平台依赖

以下仅用于已安装本源码的仓库根目录(pip 包不含顶层 examples):先运行 python3 -m imprint --version,应输出 imprint 0.14.0;再运行 python3 -m imprint examples/sample.md --out sample.pdf 完成离线样例。需要 Python 3.10+、项目依赖,以及 WeasyPrint 的原生 Pango/GLib:macOS 用 Homebrew 安装 Pango,Debian/Ubuntu 安装 libpango-1.0-0 与 libpangoft2-1.0-0,Windows 安装当前 GTK3 runtime。中文字体需由使用者自行安装。

质检分数是本仓库检查项的可重复启发式评分,不是印刷厂认证;PDF/UA 行只检查 Tagged PDF 标记,并不等同于完整 PDF/UA 合规。正式发布仍需专用无障碍校验器和人工印前打样。

完整安装指南和平台矩阵见 首次成功指南。源码版本与注册表版本可能不同;发布前请分别核对 PyPI、npm 和 GitHub Release。

[封面]

[目录]

[正文]

[提示框]

[mermaid 流程图]

主题画廊(24 套 · 全部通过印刷级质检)

[modern] [academic] [nord] [sepia] [newspaper]

[catppuccin] [mono] [jade] [coffee] [ocean]

[lavender] [rose] [pine] [wine] [graphite]

[midnight] [coral] [amber] [mint] [sand]

[minimal] [ink] [gongwen 公文] [ieee 英文论文]

双栏学术论文模板

imprint --new paper 一键生成双栏学术论文:摘要/关键词通栏,正文双栏排版,标题不落页尾、表格不跨栏截断、行内公式不断行。

[paper 双栏正文] [paper 双栏图表]

英文论文用 imprint --new ieee:IEEE 风格(Times 10pt 紧凑双栏 + IEEE 蓝), lang: en 自动切换文档语言标签,Abstract / Index Terms 通栏。

[ieee 双栏英文论文]

公文风格模板(不宣称 GB/T 9704 合规)

imprint --new gongwen 生成公文风格草稿(未按 GB/T 9704 全项验证,不宣称标准合规): 红色发文机关标志、发文字号、红色分隔线(★)、黑体标题、仿宋三号正文、 右对齐落款与成文日期。

[gongwen 红头文件]

换肤 = 一行命令:imprint paper.md --theme wine;不指定也会智能换肤——自动分析内容气质选主题并说明理由(如周报自动用 graphite,论文自动用 academic)。

为什么是 Imprint

大多数 Markdown→PDF 工具(pandoc 默认、md2pdf 系、Chrome 打印)只是"把文字倒进页面"。Imprint 的三个差异点:

  • 中文印刷级——严格按《中文排版需求》:避头尾禁则、首行缩进 2 字符、中英文混排字距、孤行寡行控制
  • 设计系统即主题——每套主题是一组 DTCG 设计令牌(色板/字体配对/间距/装饰),换肤 = 换一行
  • 印刷级质检报告——每个 PDF 生成后自动评分 0–100,检查文本可选、字体子集嵌入、标点违规、目录页码、Tagged PDF 标记,证据可查

快速开始

bash
pip install imprint-pdf# 图表支持(可选)pip install imprint-pdf[charts]# MCP server(可选,Agent 一句话出报告)pip install imprint-pdf[mcp]
imprint paper.md -o paper.pdfimprint paper.md --theme sepia --compress# 从模板起稿(报告/书籍/简历/技术文档/信函)imprint --new report -o my_report.md# 启动 MCP server(stdio),供 Claude Code / Cursor / DeepSeek Harness 等接入imprint-mcp

输出结尾是一张质检报告:

印刷级质检报告============================================== ✓ 文本可选              15.0/15.0   平均每页 722 字符 ✓ 字体子集嵌入            15.0/15.0   5/5 字体已嵌入 ✓ 元数据完整              3.0/3.0    标题「印记」 ✓ 标点避头尾             15.0/15.0   0 违规 ✓ 孤行寡行               9.0/9.0    0 处 ✓ 目录页码              15.0/15.0   核对 15 条 ✓ 页码存在               2.0/2.0    8/9 页含页码 ✓ Tagged PDF 标记          3.0/3.0    Tagged PDF ✓ 主题字体生效             3.0/3.0    命中 songti ✓ 主题对比度              5.0/5.0    正文 17.0:1 … ✓ 缺字检测               5.0/5.0    无缺字回退 ✓ 内容溢出               5.0/5.0    无内容越界 ✓ 图片清晰度              5.0/5.0    全部达标 ---------------------------------------------- 总分 100.0/100 · 等级 A+ · 9 页

特性

  • 封面 + 目录:frontmatter 里的 title / author / date 自动生成封面,标题自动生成可点击目录(页码精确)
  • 智能换肤:不指定主题时,按标题/关键词/正文信号自动推荐(含理由);显式指定优先
  • 主题系统:24 套主题(见下方画廊)——现代杂志 / 学术书卷 / 北欧极简 / 护眼纸色 / 报纸头版 / 柔和粉彩 / 纯黑白 / 玉石绿 / 咖啡暖棕 / 海洋蓝 / 薰衣草紫 / 樱粉 / 松林绿 / 勃艮第酒红 / 石墨灰 / 深夜蓝纸(暗色)/ 珊瑚橙 / 琥珀金 / 薄荷青 / 沙漠沙色 / 极简(minimal) / 线装书(ink,宣纸+印章红) / 红头公文(gongwen) / IEEE 英文论文(ieee),自定义主题 = 一个 JSON 文件
  • GitHub 风格提示框:> [!NOTE] / [!TIP] / [!WARNING] / [!IMPORTANT] / [!CAUTION] 自动渲染为印刷级彩色提示卡,见 examples/alerts.md
  • Mermaid 图表:```mermaid 代码块自动渲染为矢量图(中文正常、无限缩放),未装引擎时优雅回退代码块,见 examples/charts.md
  • 数学公式:$行内公式$ / $$块级公式$$ 渲染为矢量 SVG(matplotlib mathtext,无数学字体依赖),见 examples/math.md
  • 模板系统:imprint --new report|book|resume|techdoc|letter|paper|gongwen|ieee 一键起稿,模板自带对应排版气质(石墨灰报告 / 米黄书稿 / 等宽简历 / 海洋蓝技术文档 / 薰衣草信函 / 双栏学术论文 / 红头公文 / IEEE 英文论文)
  • 图片压缩:--compress 自动降采样超大图并重编码(实测 11.7MB → 1.4MB)
  • 字体体检:生成前自动检查主题字体本机是否可用,缺失时明确警告
  • 中文规范:避头尾禁则、首行缩进、中英文混排、英文段落自动连字
  • 表格跨页:表头自动重复、行不截断
  • 代码高亮:Pygments 着色、整体换页不截断
  • 缺字检测:渲染后扫描 LastResort/notdef 回退(豆腐块),脚注、箭头等符号缺字自动暴露
  • 带标签 PDF:默认请求 WeasyPrint PDF/UA-1 输出模式;完整无障碍合规仍需验证
  • AI 原生:CLI 一行命令;内置 MCP server(pip install "imprint-pdf[mcp]" → imprint-mcp),实际工具名为 render_markdown、list_themes_tool、validate_pdf_tool、new_document_tool。Docker 与 Glama 前置步骤见容器接入说明。
  • 对比度合规:按主题色板计算 WCAG 对比度比值(正文 ≥7:1、小字 ≥4.5:1、装饰 ≥3:1)

能力边界

Imprint 组合了 Markdown 排版、主题与启发式检查。其他工具的能力依版本和插件配置而异;本项目没有受控竞品测试,不作绝对优劣比较。

文档

路线图

  • 更多主题(24 套已上线:minimal / ink / gongwen / ieee 等)
  • npm 分发 npx imprint-pdf(已上线)
  • 双栏 / 学术模板(已上线)
  • PyPI 发布(注册表版本与源码可能不同)
  • 更多双栏模板(IEEE / 公文 / 病历等)

Related tools

  • falsify — the scientific thinking protocol for AI agents. Before you typeset the perfect PDF, let falsify check the conclusion it presents: hypothesis → falsify → evidence → calibrated verdict.
  • dsh-verify — browser-verified delivery for agent-built apps: real-browser tests that catch broken output a judge cannot see.

One-command installs: npx skills add 263311487-ux/falsify · npx dsh-verify · npx imprint-pdf

License

MIT

Source: README.md at commit 891b855

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.14.0LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts