Images set to fit get cut off when they reach the end of the page - is there a solution in place?
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
- 领域
- tooling
调研方向
该 issue 未提供文件或测试入口;请先沿着布局流程追踪 doc.image 和 moveDown 调用。使用 fit [575,575] 配置两张 3840×2160 的图像来复现该情况,然后验证当剩余垂直空间不足时,第二张图像会移动到新页面。
由索引模型根据 Issue 内容生成。
描述
Question
Description
Not sure where this belongs - either a feature request or less likely, a bug...
I have a bunch of text on the pdf and then I immediately follow it with moveDown (with a value of 1). And then I insert 2 images (for testing purposes, they're both 3840px x 2160px).
The 2nd image gets cut off at the end of the page.
Is there an easy way to tell pdfkit to "move this image to a new page if there's not enough vertical white space for it to fit?"
The hacky solution is to put each image on a new page, but this isn't ideal.
Code sample
doc.image('images/image1,png', undefined, undefined, {fit: [575, 575]});
doc.image('images/image2,png', undefined, undefined, {fit: [575, 575]});
Your environment
- pdfkit version: Latest
- Node version: Latest
- Browser version (if applicable): Chromium and Chromium variants
- Operating System: Win 11
- 主要语言
- JavaScript
- 星标
- 10.7k
- 派生
- 1.2k
- 平均合并
- 21 小时 41 分钟
- 30 天内合并 PR
- 27
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
foliojs/pdfkit 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
PDFKit crashes when providing fonts as Buffer in table可能已有人在做 @ykw9263 于 131 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
foliojs/pdfkit#1743 · 13 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
foliojs/pdfkit#1512 · 1 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 45/100
维护者通常 1 天内回复
相似的 Issue
-
good first issue help wanted
难度 1/5 1 小时以内 新手友好度 88/100
modrollstudio/Modroll-Studio-Website#80 · 1 条评论 ·
维护者通常 1 天内回复
-
good first issue help wanted
难度 1/5 1 小时以内 新手友好度 82/100
-
area: panel enhancement
难度 1/5 1 小时以内 新手友好度 72/100
GabrielGirardi/ledge#7 ·
-
0. Needs triage 35-feedback bug
难度 1/5 1 小时以内 新手友好度 62/100
维护者通常 1 天内回复
-
A-linter
难度 2/5 1-3 小时 新手友好度 73/100
oxc-project/oxc#28783 ·
维护者通常 1 天内回复