pdf-lib-extended 1.0.9 → 1.0.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pdf-lib-extended",
3
- "version": "1.0.9",
3
+ "version": "1.0.12",
4
4
  "description": "This project extends the capabilities of the pdf-lib JavaScript library by providing a set of helper functions that simplify common PDF manipulation tasks. It includes utilities for drawing and formatting text, images, and shapes within PDF documents, allowing for more advanced customization and automation. The class-based architecture, designed as a toolkit, ensures that developers can easily integrate these enhanced features into their existing workflows. With this extension, users can streamline the creation of dynamic and complex PDFs with minimal effort.",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -124,7 +124,7 @@ class PDFLibExtended {
124
124
  */
125
125
  setMargin(arr) {
126
126
  try {
127
- if (typeof arr != 'object' || arr === null || !Array.isArray(arr)) throw new Error("The value supplied is not a JSON/Array: ", arr);
127
+ if (typeof arr != 'object' || arr === null || Array.isArray(arr)) throw new Error("The value supplied is not a JSON/Object: ", arr);
128
128
  this.#margin = {
129
129
  ...this.#margin,
130
130
  ...arr
@@ -374,8 +374,8 @@ class PDFLibExtended {
374
374
  /**
375
375
  *### Moves the pointer to the next line of the current page
376
376
  */
377
- nextLine() {
378
- this.getCurrentPage().moveTo(this.getMargin().left, this.getCurrentPage().getY() - this.getTextSize());
377
+ nextLine(padding = 0) {
378
+ this.getCurrentPage().moveTo(this.getMargin().left, this.getCurrentPage().getY() - this.getTextSize() - padding);
379
379
  }
380
380
 
381
381
  /**