pdf-lib-extended 1.0.27 → 1.0.29

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.27",
3
+ "version": "1.0.29",
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": {
@@ -573,7 +573,7 @@ class PDFLibExtended {
573
573
  /*** TEXT ***/
574
574
  let change = page.getY();
575
575
  this.drawParagraph(text, {range: {left: x, right: x + width}, align: defaultOptions.align, size: defaultOptions.size, color: defaultOptions.color});
576
- change -= page.getY() - defaultOptions.size;
576
+ change -= page.getY() - defaultOptions.size - 4;
577
577
 
578
578
  /*** BACKGROUND ***/
579
579
  if(defaultOptions.backgroundColor !== null){
@@ -596,7 +596,7 @@ class PDFLibExtended {
596
596
  page.moveTo(x, y);
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
- change -= page.getY() - defaultOptions.size;
599
+ change -= page.getY() - defaultOptions.size - 4;
600
600
 
601
601
  y += defaultOptions.size;
602
602
 
@@ -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
  }