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

Is it normal for strings to be rendered slightly differently three times than once? #1520

Open
luckymore opened this issue May 17, 2024 · 0 comments

Comments

@luckymore
Copy link

Bug Report

The left side is rendered using continued and the right side is rendered once using text, but the results are inconsistent.

Description of the problem

image

Code sample

// create a document and pipe to a blob
var doc = new PDFDocument();
var stream = doc.pipe(blobStream());

// draw some text
var a = 'Click here to visit OpenAI website:'
var b = 'The advent of Large Language Models (LLMs)'
var c = 'end with a link'

doc.fontSize(12)

// left
doc
.text(a, 20, 20, { width: 200, continued: true })
.text(b)
.text(c)

// right
doc.text(a + b + c, 300, 20, { width: 200, continued: true })

// end and display the document in the iframe to the right
doc.end();
stream.on('finish', function() {
  iframe.src = stream.toBlobURL('application/pdf');
});

Your environment

https://pdfkit.org/demo/browser.html

  • pdfkit version:
  • Node version:
  • Browser version (if applicable):
  • Operating System:
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