text() method removes existing newlines when maxWidth is given
See original GitHub issueHi!
It is very powerful library but I’ve found one small bug.
If I use Text method with only one option it will correctly reproduce carriage return
var pDoc = new jsPDF('p','mm','a4');
pDoc.text('Some text on first line\rSome text on second line', 105, 10, 'center');
but if I use option maxWidth then carriage returns are ignored
var pDoc = new jsPDF('p','mm','a4');
pDoc.text('Some text on first line\rSome text stay on same line', 105, 10, {align: 'center', maxWidth: 190);
Issue Analytics
- State:
- Created 4 years ago
- Comments:8
Top Results From Across the Web
Cause line to wrap to new line after 100 characters
Your line isn't breaking naturally because you don;t have any spaces in it. You can use word-wrap to force the breaks, then add...
Read more >textwrap — Text wrapping and filling — Python 3.11.1 ...
Wraps the single paragraph in text (a string) so every line is at most width characters long. Returns a list of output lines,...
Read more >text-overflow - CSS: Cascading Style Sheets - MDN Web Docs
The text-overflow CSS property sets how hidden overflow content is signaled to users. It can be clipped, display an ellipsis ('…
Read more >overflow-wrap | CSS-Tricks
The overflow-wrap property in CSS allows you to specify that the browser can break a line of text inside the targeted element onto...
Read more >Textwrap – Text wrapping and filling in Python - GeeksforGeeks
replace_whitespace: It's default value is set to TRUE. If the value is true, after tab expansion but before wrapping, the wrap() method replaces ......
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
If you don’t want to correct it, at least update the documentation to specify it.
This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.