pdf-lib-extended 1.0.43 → 1.0.44

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.43",
3
+ "version": "1.0.44",
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": {
@@ -419,7 +419,7 @@ class PDFLibExtended {
419
419
  opacity: defaultOptions.opacity
420
420
  });
421
421
  if(defaultOptions.textDecoration === "underline"){
422
- this.pdf.drawLine({
422
+ this.getCurrentPage().drawLine({
423
423
  start: { x: this.getCurrentPage().getX(), y: this.getCurrentPage().getY() - 2 },
424
424
  end: { x: this.getCurrentPage().getX() + this.getCurrentFont().widthOfTextAtSize(text, defaultOptions.size), y: this.getCurrentPage().getY() - 2 },
425
425
  thickness: 1,
@@ -446,7 +446,7 @@ class PDFLibExtended {
446
446
  opacity: defaultOptions.opacity
447
447
  });
448
448
  if(defaultOptions.textDecoration === "underline"){
449
- this.pdf.drawLine({
449
+ this.getCurrentPage().drawLine({
450
450
  start: { x: xCenterPosition, y: this.getCurrentPage().getY() - 2 },
451
451
  end: { x: xCenterPosition + this.getCurrentFont().widthOfTextAtSize(text, defaultOptions.size), y: this.getCurrentPage().getY() - 2 },
452
452
  thickness: 1,
@@ -473,7 +473,7 @@ class PDFLibExtended {
473
473
  opacity: defaultOptions.opacity
474
474
  });
475
475
  if(defaultOptions.textDecoration === "underline"){
476
- this.pdf.drawLine({
476
+ this.getCurrentPage().drawLine({
477
477
  start: { x: xRightPosition, y: this.getCurrentPage().getY() - 2 },
478
478
  end: { x: xRightPosition + textWidth, y: this.getCurrentPage().getY() - 2 },
479
479
  thickness: 1,