-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Question
I'm using pdfkit to generate text where syllables are differently colored.
I'm having an issue to avoid line breaks in the middle of a word because I call .text() each time I want to change color.
Is it possible to make that 2 calls are unbreakable ?
Code sample
You can test if you put this code in https://pdfkit.org/examples/browserify/browser.html
var doc = new PDFDocument();
var stream = doc.pipe(blobStream());
doc.fontSize(25)
.text("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", {continued: true})
.text("bb", {continued:true})
.fillColor("red")
.text("b", {continued: true})
doc.end();
stream.on('finish', function() {
iframe.src = stream.toBlobURL('application/pdf');
});
As you can see, I need the multiple b to be one word but with different colors and it breaks
is there a way to avoid the break ?
Metadata
Metadata
Assignees
Labels
No labels