Multiline URLs not rendered as clickable links in generated PDF

オープン
#1,503 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
backend

調査の方向性

まず、提供されている pdfkit Node.js の再現コードをバージョン 0.14.0 で実行し、生成された PDF をビューアーで確認します。doc.text が URL を複数行にまたがって折り返すときに、link オプションと underline オプションがどのように処理されるかを追跡します。単一行の URL と複数行の URL の両方がクリック可能なリンクとして表示されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

needs info

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
平均マージ
21時間 41分
マージ済み PR(30日)
27

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

foliojs/pdfkit のほかの issue

foliojs/pdfkit の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。