Add margin to templates generation.

This commit is contained in:
Patrick Fic
2022-03-21 10:51:44 -07:00
parent 592b47b5d4
commit 7ccd356f0a

View File

@@ -30,7 +30,21 @@ export default async function RenderTemplate(
name: useShopSpecificTemplate
? `/${bodyshop.imexshopid}/${templateObject.name}`
: `/${templateObject.name}`,
...(renderAsHtml ? {} : { recipe: "chrome-pdf" }),
...(renderAsHtml
? {}
: {
recipe: "chrome-pdf",
chrome: {
marginTop:
(bodyshop.logo_img_path &&
bodyshop.logo_img_path.headerMargin) ||
"36px",
marginBottom:
(bodyshop.logo_img_path &&
bodyshop.logo_img_path.footerMargin) ||
"36px",
},
}),
...(renderAsExcel ? { recipe: "html-to-xlsx" } : {}),
},
data: {
@@ -151,7 +165,7 @@ export async function RenderTemplates(
};
try {
const render = await jsreport.renderAsync(reportRequest);
const render = await jsreport.renderAsync({ reportRequest });
if (!renderAsHtml) {
render.download("Speed Print");
} else {