p3x-html-pdf 2023.4.138 → 2023.4.142

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/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
 
13
13
 
14
- # 📃 Generates PDF from HTML with custom headers and footers with wkhtmltopdf v2023.4.138
14
+ # 📃 Generates PDF from HTML with custom headers and footers with wkhtmltopdf v2023.4.142
15
15
 
16
16
 
17
17
 
@@ -67,7 +67,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://
67
67
 
68
68
  ---
69
69
 
70
- [**P3X-HTML-PDF**](https://corifeus.com/html-pdf) Build v2023.4.138
70
+ [**P3X-HTML-PDF**](https://corifeus.com/html-pdf) Build v2023.4.142
71
71
 
72
72
  [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
73
73
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "p3x-html-pdf",
3
- "version": "2023.4.138",
3
+ "version": "2023.4.142",
4
4
  "corifeus": {
5
5
  "prefix": "p3x-",
6
6
  "publish": true,
package/src/index.js CHANGED
@@ -162,6 +162,13 @@ var qr = ${JSON.stringify(mainsSettings.settings.qr)};
162
162
  marginTop = '0mm';
163
163
  marginBottom = '0mm';
164
164
  addOn += ` --margin-left 0mm --margin-right 0mm --disable-smart-shrinking`
165
+ } else {
166
+ if (settings.template.marginLeft !== null && settings.template.marginLeft !== undefined) {
167
+ addOn += ` --margin-left ${settings.template.marginLeft}mm `
168
+ }
169
+ if (settings.template.marginRight != null && settings.template.marginLeft !== undefined) {
170
+ addOn += ` --margin-right ${settings.template.marginRight}mm `
171
+ }
165
172
  }
166
173
  const pageSize = isFixed() ? `--page-width ${settings.template.fixedWidth + 1}mm --page-height ${settings.template.fixedHeight + 1}mm` : `--page-size ${settings.template.format}`;
167
174
  const generatePdfCommand = `${binpath} --javascript-delay ${javascriptDelay} --copies ${settings.template.copies} --margin-bottom ${marginBottom} --margin-top ${marginTop} ${addOn} ${debug ? '--debug-javascript' : ''} --title ${JSON.stringify(title + ' ' + new Date().toLocaleString())} --orientation ${startCase(settings.template.orientation)} ${pageSize} ${tmpHtmlPath} --header-html ${tmpHtmlPathHeader} --footer-html ${tmpHtmlPathFooter} ${tmpPdfPath}`;