shareneus 1.6.72 → 1.6.74

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.
@@ -62,6 +62,7 @@ function GetInvoicePdfDataUrl(PDFInvoiceData = {}, PrintConfigData = {}, printCo
62
62
  // });
63
63
  }
64
64
  function buildPdfDocDefinition(PDFInvoiceData = {}, PrintConfigData = {}, printCopies = []) {
65
+ var _a;
65
66
  const PrintConfig = normalizePrintConfig(PDFInvoiceData, PrintConfigData);
66
67
  const requestedPageOrientation = (0, pdf_header_footer_section_1.resolvePageOrientation)((PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.Orientation) || (PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.PageOrientation));
67
68
  const pageSize = (0, pdf_header_footer_section_1.resolvePageSize)(PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.PSize, requestedPageOrientation);
@@ -71,9 +72,14 @@ function buildPdfDocDefinition(PDFInvoiceData = {}, PrintConfigData = {}, printC
71
72
  const background = (0, pdf_header_footer_section_1.buildLogoWatermarkBackground)(PrintConfig, PDFInvoiceData);
72
73
  const pageHeader = (0, pdf_header_footer_section_1.buildPageNumberHeader)(PrintConfig);
73
74
  const pageFooter = (0, pdf_header_footer_section_1.buildFooter)(PrintConfig);
74
- const pageMargins = pageHeader !== null
75
+ let pageMargins = pageHeader !== null
75
76
  ? [basePageMargins[0], Math.max(basePageMargins[1], 18), basePageMargins[2], basePageMargins[3]]
76
77
  : basePageMargins;
78
+ const raw = String((_a = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.PSize) !== null && _a !== void 0 ? _a : '').trim().toLowerCase();
79
+ const normalized = raw.replace(/[\s_-]/g, '');
80
+ if (normalized === 'halfa4') {
81
+ pageMargins = [25, 15, 25, 435.945];
82
+ }
77
83
  const availableWidth = (0, pdf_table_section_1.getAvailablePageWidth)(pageSize, requestedPageOrientation, pageMargins);
78
84
  const content = [];
79
85
  copyLabels.forEach((copyLabel, index) => {
@@ -31,7 +31,8 @@ function resolvePageSize(value, orientation = DEFAULT_PAGE_ORIENTATION) {
31
31
  const raw = String(value !== null && value !== void 0 ? value : '').trim().toLowerCase();
32
32
  const normalized = raw.replace(/[\s_-]/g, '');
33
33
  if (normalized === 'halfa4') {
34
- return { width: A4_WIDTH, height: HALF_A4_HEIGHT };
34
+ // return { width: A4_WIDTH, height: HALF_A4_HEIGHT };
35
+ return 'A4';
35
36
  }
36
37
  if (normalized === 'letter') {
37
38
  return 'LETTER';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.6.72",
3
+ "version": "1.6.74",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",