Trying to print outside of margins causes pdfkit to hang (infinite loop)
See original GitHub issueExample:
doc = new PDFDocument({size: 'A4', margin: 20});
doc.text("29.12.2015", 600, 20);
Pdfkit get stuck in LineWrapper.prototype.eachWord
, because this.spaceLeft
is negative:
while (w > this.spaceLeft) {
w = this.wordWidth(word.slice(0, --l));
}
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Why PDFKit doesn't work well with margins? - Stack Overflow
I tried different combinations of margins, paddings and heights and nothing: when I just add margins or paddings, the PDF gets crazy. (Note: ......
Read more >@foliojs-fork/pdfkit | Yarn - Package Manager
PDFKit is a PDF document generation library for Node and the browser that makes creating complex, multi-page, printable documents easy.
Read more >why are pdf documents printing out with left side partially cut off?
1 Correct answer. There are no margin controls. What you have is a choice of two ways of printing: 1.
Read more >WebCore/ChangeLog - external/Webkit - Git at Google
Fix for hang when incorrectly trying to add before/after content to. a <select>. ... This caused an infinite loop in RenderFlow::destroy(). This patch....
Read more >Print To Screen and Then Print To Printer causing infinite loop
support@digital-metaphors.com. ... infinite state where page after empty page prints forever. There are a few items to check when this occurs.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the same issue. The expected behavior would be to just ignore the command as it would be printed outside the doc.
As described in #479 - use
{lineBreak: false}
as a workaround