Skip to content
Merged

BUGFIX: #1686

Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Add robust handling of null byte padding in JPEG images
- Replace outdated jpeg-exif with minimal implementation
- Replace outdated crypto-js with maintained small alternatives
- Fix issue with indentation with `indentAllLines: true` when a new page is created

### [v0.17.2] - 2025-08-30

Expand Down
9 changes: 8 additions & 1 deletion lib/line_wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class LineWrapper extends EventEmitter {
this.document = document;
this.horizontalScaling = options.horizontalScaling || 100;
this.indent = ((options.indent || 0) * this.horizontalScaling) / 100;
this.indentAllLines = options.indentAllLines || false;
this.characterSpacing =
((options.characterSpacing || 0) * this.horizontalScaling) / 100;
this.wordSpacing =
Expand Down Expand Up @@ -348,7 +349,13 @@ class LineWrapper extends EventEmitter {
this.column = 1;
this.startY = this.document.page.margins.top;
this.maxY = this.document.page.maxY();
this.document.x = this.startX;
if (this.indentAllLines) {
const indent = this.continuedX || this.indent;
this.document.x += indent;
this.lineWidth -= indent;
} else {
this.document.x = this.startX;
}
if (this.document._fillColor) {
this.document.fillColor(...this.document._fillColor);
}
Expand Down