diff --git a/workers/loc.api/generate-report-file/pdf-writer/index.js b/workers/loc.api/generate-report-file/pdf-writer/index.js index a73eca63b..90bf60cd7 100644 --- a/workers/loc.api/generate-report-file/pdf-writer/index.js +++ b/workers/loc.api/generate-report-file/pdf-writer/index.js @@ -61,7 +61,9 @@ class PdfWriter extends MainPdfWriter { const { template = 'No data', format = 'portrait', - orientation = 'Letter' + orientation = 'Letter', + headerHeight = '65mm', + footerHeight = '28mm' } = args ?? {} if (this.isElectronjsEnv) { @@ -72,8 +74,18 @@ class PdfWriter extends MainPdfWriter { }) } + const headerOpt = headerHeight + ? { header: { height: headerHeight } } + : {} + const footerOpt = footerHeight + ? { footer: { height: footerHeight } } + : {} + return await new Promise((resolve, reject) => { pdf.create(template, { + ...headerOpt, + ...footerOpt, + format, orientation, type: 'pdf', diff --git a/workers/loc.api/generate-report-file/pdf-writer/templates/full-snapshot-report.pug b/workers/loc.api/generate-report-file/pdf-writer/templates/full-snapshot-report.pug index 5bb6963e3..adbfd50ac 100644 --- a/workers/loc.api/generate-report-file/pdf-writer/templates/full-snapshot-report.pug +++ b/workers/loc.api/generate-report-file/pdf-writer/templates/full-snapshot-report.pug @@ -18,7 +18,7 @@ block content :translate(prop='template.positions') Positions - ul.responsive-table.sm.no-margin-bottom + ul.responsive-table.no-margin-bottom li.table-header each columnVal, columnKey in reportColumns.positionsSnapshot .col #{columnVal} @@ -27,7 +27,7 @@ block content each columnVal, columnKey in reportColumns.positionsSnapshot .col #{dataItem[columnKey]} - ul.responsive-table.sm.width-by-content + ul.responsive-table.width-by-content li.table-header each columnVal, columnKey in reportColumns.positionsTotalPlUsd .col #{columnVal} diff --git a/workers/loc.api/generate-report-file/pdf-writer/templates/full-tax-report.pug b/workers/loc.api/generate-report-file/pdf-writer/templates/full-tax-report.pug index 75051747c..3c524322b 100644 --- a/workers/loc.api/generate-report-file/pdf-writer/templates/full-tax-report.pug +++ b/workers/loc.api/generate-report-file/pdf-writer/templates/full-tax-report.pug @@ -15,7 +15,7 @@ block content :translate(prop='template.startingPositionsSnapshot') Starting positions snapshot - ul.responsive-table.sm + ul.responsive-table li.table-header each columnVal, columnKey in reportColumns.positionsSnapshot .col #{columnVal} @@ -28,7 +28,7 @@ block content :translate(prop='template.endingPositionsSnapshot') Ending positions snapshot - ul.responsive-table.sm + ul.responsive-table li.table-header each columnVal, columnKey in reportColumns.positionsSnapshot .col #{columnVal} @@ -57,7 +57,7 @@ block content :translate(prop='template.movementsDetails') Movements details - ul.responsive-table.sm.no-margin-bottom + ul.responsive-table.no-margin-bottom li.table-header each columnVal, columnKey in reportColumns.movements .col #{columnVal} @@ -66,7 +66,7 @@ block content each columnVal, columnKey in reportColumns.movements .col #{dataItem[columnKey]} - ul.responsive-table.sm.width-by-content + ul.responsive-table.width-by-content li.table-header each columnVal, columnKey in reportColumns.movementsTotalAmount .col #{columnVal}