pdf-lib-extended 1.0.34 → 1.0.36

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.34",
3
+ "version": "1.0.36",
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": {
@@ -603,7 +603,7 @@ class PDFLibExtended {
603
603
  if(defaultOptions.border){
604
604
  page.drawRectangle({
605
605
  x: x,
606
- y: y - drawParagraphResponse.height + defaultOptions.size,
606
+ y: y - drawParagraphResponse.height + defaultOptions.size - defaultOptions.padding,
607
607
  width: width,
608
608
  height: drawParagraphResponse.height,
609
609
  color: defaultOptions.backgroundColor,
@@ -614,7 +614,7 @@ class PDFLibExtended {
614
614
  }else{
615
615
  page.drawRectangle({
616
616
  x: x,
617
- y: y - drawParagraphResponse.height + defaultOptions.size,
617
+ y: y - drawParagraphResponse.height + defaultOptions.size - defaultOptions.padding,
618
618
  width: width,
619
619
  height: drawParagraphResponse.height,
620
620
  color: defaultOptions.backgroundColor,
@@ -634,10 +634,10 @@ class PDFLibExtended {
634
634
  opacity: 1,
635
635
  });
636
636
 
637
- if(defaultOptions.newLine){
638
- page.moveTo(page.getX(), y - drawParagraphResponse.height);
639
- }
640
- else page.moveTo(x + width, y);
637
+ return {
638
+ height: drawParagraphResponse.height,
639
+ padding: defaultOptions.padding
640
+ };
641
641
  }
642
642
 
643
643
  /**