Add WeasyPrint to convert PDFs
This commit is contained in:
@ -5,27 +5,24 @@
|
||||
<html lang="de-AT">
|
||||
<head>
|
||||
<title>@Model.Title</title>
|
||||
<meta name="author" value="@Model.Author"/>
|
||||
<meta charset="UTF-8"/>
|
||||
<script>
|
||||
window.PagedConfig = { auto: false };
|
||||
if (!navigator.webdriver) {
|
||||
window.addEventListener("beforeprint", async () => { await window.PagedPolyfill.preview(); });
|
||||
window.addEventListener("afterprint", () => { location.reload(); });
|
||||
}
|
||||
|
||||
const heightA4 = 297, widhtA4 = 210, heightFooter = 35, heightHeader = 25;
|
||||
const heightMain = heightA4 - heightFooter - heightHeader;
|
||||
function px2mm(px1, px2) {
|
||||
return (px2 - px1 + 1) * 2.54 / 96 * window.devicePixelRatio * 10;
|
||||
}
|
||||
</script>
|
||||
<script src="file:///@Raw(Model.DataPath)\resources\paged.polyfill.js"></script>
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\style.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="m1"></div>
|
||||
<div class="m2"></div>
|
||||
<div class="m3"></div>
|
||||
<div class="m1 r"></div>
|
||||
<div class="m2 r"></div>
|
||||
<div class="m3 r"></div>
|
||||
<div class="footer-wrapper">
|
||||
<div class="pre-footer">
|
||||
<span class="date">@($"{Model.Date:dddd, d. MMMM yyyy}")</span>
|
||||
|
Reference in New Issue
Block a user