pols-pdf 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -165,7 +165,7 @@ export type PCellParams = {
165
165
  } & ({
166
166
  height: number;
167
167
  } | {
168
- autojump: true | undefined;
168
+ autojump?: boolean;
169
169
  });
170
170
  export type PRow = {
171
171
  cells: Omit<PCell, 'autojump'>[];
package/dist/index.js CHANGED
@@ -205,7 +205,7 @@ class PPdf {
205
205
  top: cursorTop,
206
206
  width: usefulWidth,
207
207
  font: params.font,
208
- autojump: (params.autojump ?? true) ? true : undefined
208
+ autojump: params.autojump ?? true
209
209
  });
210
210
  if (preparedRow.currentPage.cells.some(cell => cell.letters?.length)) {
211
211
  buffer.rows.push(preparedRow.currentPage);
@@ -305,7 +305,7 @@ class PPdf {
305
305
  top: top + padding.top,
306
306
  width: cellWidth,
307
307
  font: cell.font ?? params.font,
308
- autojump: (params.autojump ?? true) ? true : undefined,
308
+ autojump: params.autojump ?? true,
309
309
  complete: params.complete
310
310
  });
311
311
  response.currentPage.cells.push(preparedCell.currentPage);
@@ -578,7 +578,7 @@ class PPdf {
578
578
  if (!firstLetterOfLine)
579
579
  continue;
580
580
  /* Si la letra se desborda, se crea un nuevo párrafo */
581
- if ('autojump' in params && currentParagraph != 'nextPage' && firstLetterOfLine.top + firstLetterOfLine.height + padding.bottom > (this.engine.page.height - this.engine.page.margins.bottom)) {
581
+ if (!('height' in params) && (params.autojump ?? true) && currentParagraph != 'nextPage' && firstLetterOfLine.top + firstLetterOfLine.height + padding.bottom > (this.engine.page.height - this.engine.page.margins.bottom)) {
582
582
  if (params.complete) {
583
583
  paragraphs.nextPage = paragraphs.currentPage;
584
584
  paragraphs.currentPage = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pols-pdf",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {