Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/jspdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3907,11 +3907,15 @@ function jsPDF(options) {
for (var l = 0; l < len; l++) {
newY = l === 0 ? getVerticalCoordinate(y) : -leading;
newX = l === 0 ? getHorizontalCoordinate(x) : 0;

let numSpaces = da[l].split(" ").length - 1;
let spacing = numSpaces > 0 ? (maxWidth - lineWidths[l]) / numSpaces : 0;

if (l < len - 1) {
wordSpacingPerLine.push(
hpf(
scale(
(maxWidth - lineWidths[l]) / (da[l].split(" ").length - 1)
(spacing)
)
)
);
Expand Down
Loading