pdf-lib-extended 1.0.28 → 1.0.30

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.28",
3
+ "version": "1.0.30",
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": {
@@ -593,7 +593,7 @@ class PDFLibExtended {
593
593
  }
594
594
 
595
595
  /*** TEXT ***/
596
- page.moveTo(x, y);
596
+ page.moveTo(x, y - defaultOptions.padding);
597
597
  change = page.getY();
598
598
  this.drawParagraph(text, {range: {left: x, right: x + width}, align: defaultOptions.align, size: defaultOptions.size, color: defaultOptions.color});
599
599
  change -= page.getY() - defaultOptions.size - 4;
@@ -646,7 +646,7 @@ class PDFLibExtended {
646
646
 
647
647
  if(defaultOptions.newLine){
648
648
  this.nextLine(defaultOptions.padding);
649
- page.moveTo(page.getX(), y - Number(defaultOptions.height) - change - defaultOptions.size - defaultOptions.padding);
649
+ page.moveTo(page.getX(), y - Number(defaultOptions.height) - change - defaultOptions.size - defaultOptions.padding - 5);
650
650
  }
651
651
  else page.moveTo(x + width + defaultOptions.padding, y - defaultOptions.size);
652
652
  }