Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline URLs not rendered as clickable links in generated PDF #1503

Open
sfonua10 opened this issue Mar 15, 2024 · 0 comments
Open

Multiline URLs not rendered as clickable links in generated PDF #1503

sfonua10 opened this issue Mar 15, 2024 · 0 comments

Comments

@sfonua10
Copy link

sfonua10 commented Mar 15, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant