Multiline URLs not rendered as clickable links in generated PDF
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
- 领域
- backend
调研方向
首先使用 0.14.0 版本运行提供的 pdfkit Node.js 复现代码,并在查看器中检查生成的 PDF。跟踪 doc.text 将 URL 换行到多行时 link 和 underline 选项的处理方式;当单行 URL 和多行 URL 都能渲染为可点击链接时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Bug Report
Description of the problem
When generating PDF documents with pdfkit, I've noticed that URLs spanning multiple lines are not rendered as clickable links, whereas URLs that fit on a single line are correctly rendered as clickable. This inconsistency affects the usability of the documents, especially when long URLs are necessary. Single-line URLs work as expected.
const PDFDocument = require('pdfkit');
const fs = require('fs');
const doc = new PDFDocument();
doc.pipe(fs.createWriteStream('output.pdf'));
// Example of a multiline URL
doc.text('For more information, visit https://example.com/this-is-a-very-long-url-that-should-be-split-across-multiple-lines-but-still-be-clickable-in-the-generated-pdf', {
link: 'https://example.com/this-is-a-very-long-url-that-should-be-split-across-multiple-lines-but-still-be-clickable-in-the-generated-pdf',
underline: true
});
doc.end();
Your environment
- pdfkit version: 0.14.0
- Node version: 20.11.0
- Browser version (if applicable): Chrome
- Operating System: MacOS
- 主要语言
- JavaScript
- 星标
- 10.7k
- 派生
- 1.2k
- 平均合并
- 22 小时 55 分钟
- 30 天内合并 PR
- 25
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
foliojs/pdfkit 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
PDFKit crashes when providing fonts as Buffer in table可能已有人在做 @ykw9263 于 130 天前认领。 未关闭
难度 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 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
ready-for-agent
难度 2/5 1-3 小时 新手友好度 78/100
LucasSantana-Dev/Lucky#2945 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
brijeshb42/monaco-vim#175 ·
-
good first issue
难度 2/5 3-5 天 新手友好度 62/100
paipai1999/POS-system#3 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
MikeMcl/bignumber.js#418 ·