feat: 优化 PDF 导出并补充调试文档#143
Open
me-o wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
该 PR围绕 Issue #138(PDF 导出时表格/可横向滚动块右侧内容被截断)对现有 export-pdf 导出逻辑做增强:在不改变整体导出流程的前提下,通过注入 PDF 专用 @media print CSS 来改善表格在打印/PDF 场景下的布局,并补充了本地调试说明与新增导出命令,方便复现与迭代样式问题。
Changes:
- 在
scripts/export-pdf.js中注入面向 PDF 的打印样式,改善表格换行与溢出问题,并新增pdf-wrap-table/pdf-wide-table两种可选处理方式。 - 新增
scripts/README.md,说明pdf:single与pdf:all的用途与调试方法(含字体调试开关)。 - 在
package.json中新增pdf:single/pdf:all脚本,并在.gitignore中加入导出产物与测试列表文件的忽略规则。
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/README.md | 新增 PDF 导出调试文档,说明单页/全量导出与字体调试方式 |
| scripts/export-pdf.js | 注入 PDF 专用打印 CSS,新增针对长表格的可选样式类支持 |
| package.json | 新增 pdf:single / pdf:all 两个导出脚本入口 |
| .gitignore | 忽略 PDF 输出目录与 pdf:single 使用的列表文件 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+212
to
+216
| width: 117.65% !important; | ||
| max-width: none !important; | ||
| overflow: visible !important; | ||
| transform: scale(0.85); | ||
| transform-origin: top left; |
Collaborator
|
其实我觉得不应该专门添加 |
Contributor
Author
优化了一下当前实现,目前可以对部分表格和公式场景做简单适配
目前能覆盖大部分场景,但感觉应该还有更优雅的方案 |
5b13407 to
ff24837
Compare
Romantic-whisper
approved these changes
Jun 10, 2026
ff24837 to
2a114d7
Compare
2a114d7 to
4b6e257
Compare
Collaborator
|
@me-o 你看看你这边准备好了没有,如果没问题了就 @ 我再转 Ready for review |
Contributor
Author
Comment on lines
+5
to
+8
| ```json | ||
| "pdf:single": "bun scripts/export-pdf.js --list scripts/pdf-repo-test.txt --out-dir pdf-repo-single --concurrency 1", | ||
| "pdf:all": "bun scripts/export-pdf.js --out-dir pdf-repo --concurrency 4" | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更内容
scripts/README.md,说明pdf:single和pdf:all的调试方式优化前

优化后

优化前

优化后

Related Issue
Refs #138