Add WeasyPrint to convert PDFs

This commit is contained in:
2023-09-06 16:01:48 +02:00
parent 28b424fe65
commit 2b7d19199a
11 changed files with 136 additions and 154 deletions

View File

@ -137,11 +137,6 @@ namespace Elwig {
base.OnStartup(evt); base.OnStartup(evt);
} }
protected override void OnExit(ExitEventArgs evt) {
Utils.RunBackground("PDF Close", () => Documents.Pdf.Close());
base.OnExit(evt);
}
private void PrintingReadyChanged() { private void PrintingReadyChanged() {
Dispatcher.BeginInvoke(OnPrintingReadyChanged, new EventArgs()); Dispatcher.BeginInvoke(OnPrintingReadyChanged, new EventArgs());
} }

View File

@ -14,6 +14,4 @@
</div> </div>
<aside>@Raw(Model.Aside)</aside> <aside>@Raw(Model.Aside)</aside>
</div> </div>
<main> @RenderBody()
@RenderBody()
</main>

View File

@ -13,7 +13,7 @@ namespace Elwig.Documents {
Location = App.BranchName; Location = App.BranchName;
IncludeSender = includeSender; IncludeSender = includeSender;
var uid = (m.UstIdNr ?? "-") + (m.IsBuchführend ? "" : " <i>(pauschaliert)</i>"); var uid = (m.UstIdNr ?? "-") + (m.IsBuchführend ? "" : " <i>(pauschaliert)</i>");
Aside = $"<table><colgroup><col span='1' style='width: 2.25cm;'/><col span='1' style='width: 100%;'/></colgroup>" + Aside = $"<table><colgroup><col span='1' style='width: 22.5mm;'/><col span='1' style='width: 42.5mm;'/></colgroup>" +
$"<thead><tr><th colspan='2'>Mitglied</th></tr></thead><tbody>" + $"<thead><tr><th colspan='2'>Mitglied</th></tr></thead><tbody>" +
$"<tr><th>Mitglieds-Nr.</th><td>{m.MgNr}</td></tr>" + $"<tr><th>Mitglieds-Nr.</th><td>{m.MgNr}</td></tr>" +
$"<tr><th>Betriebs-Nr.</th><td>{m.LfbisNr}</td></tr>" + $"<tr><th>Betriebs-Nr.</th><td>{m.LfbisNr}</td></tr>" +

View File

@ -2,6 +2,8 @@
@inherits TemplatePage<Elwig.Documents.BusinessLetter> @inherits TemplatePage<Elwig.Documents.BusinessLetter>
@model Elwig.Documents.BusinessLetter @model Elwig.Documents.BusinessLetter
@{ Layout = "BusinessDocument"; } @{ Layout = "BusinessDocument"; }
<main>
<p>Sehr geehrtes Mitglied,</p> <p>Sehr geehrtes Mitglied,</p>
<p>nein.</p> <p>nein.</p>
<p>Mit freundlichen Grüßen<br/>Ihre Winzergenossenschaft</p> <p>Mit freundlichen Grüßen<br/>Ihre Winzergenossenschaft</p>
</main>

View File

@ -2,6 +2,7 @@
@inherits TemplatePage<Elwig.Documents.DeliveryNote> @inherits TemplatePage<Elwig.Documents.DeliveryNote>
@model Elwig.Documents.DeliveryNote @model Elwig.Documents.DeliveryNote
@{ Layout = "BusinessDocument"; } @{ Layout = "BusinessDocument"; }
<main>
<div class="date">@Model.Location, am @($"{Model.Date:dd.MM.yyyy}")</div> <div class="date">@Model.Location, am @($"{Model.Date:dd.MM.yyyy}")</div>
<h1>@Model.Title</h1> <h1>@Model.Title</h1>
@{ @{
@ -44,15 +45,15 @@
</script> </script>
<table class="delivery"> <table class="delivery">
<colgroup> <colgroup>
<col style="width: 1cm;"/> <col style="width: 10.00mm;"/>
<col style="width: 25%;"/> <col style="width: 21.25mm;"/>
<col style="width: 25%;"/> <col style="width: 21.25mm;"/>
<col style="width: 25%;"/> <col style="width: 21.25mm;"/>
<col style="width: 25%;"/> <col style="width: 21.25mm;"/>
<col style="width: 3cm;"/> <col style="width: 30.00mm;"/>
<col style="width: 1.25cm;"/> <col style="width: 12.50mm;"/>
<col style="width: 1.25cm;"/> <col style="width: 12.50mm;"/>
<col style="width: 1.5cm;"/> <col style="width: 15.00mm;"/>
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
@ -115,13 +116,13 @@
<div id="delivery-stats"> <div id="delivery-stats">
<table class="delivery-stats"> <table class="delivery-stats">
<colgroup> <colgroup>
<col style="width: 100%;"/> <col style="width: 45mm;"/>
<col style="width: 2cm;"/> <col style="width: 20mm;"/>
<col style="width: 2cm;"/> <col style="width: 20mm;"/>
<col style="width: 2cm;"/> <col style="width: 20mm;"/>
<col style="width: 2cm;"/> <col style="width: 20mm;"/>
<col style="width: 2cm;"/> <col style="width: 20mm;"/>
<col style="width: 2cm;"/> <col style="width: 20mm;"/>
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
@ -162,6 +163,7 @@
</table> </table>
</div> </div>
} }
</main>
@for (int i = 0; i < 2; i++) { @for (int i = 0; i < 2; i++) {
<div class="@(i == 0 ? "hidden" : "bottom")"> <div class="@(i == 0 ? "hidden" : "bottom")">
@if (Model.Text != null) { @if (Model.Text != null) {

View File

@ -5,27 +5,24 @@
<html lang="de-AT"> <html lang="de-AT">
<head> <head>
<title>@Model.Title</title> <title>@Model.Title</title>
<meta name="author" value="@Model.Author"/>
<meta charset="UTF-8"/> <meta charset="UTF-8"/>
<script> <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 heightA4 = 297, widhtA4 = 210, heightFooter = 35, heightHeader = 25;
const heightMain = heightA4 - heightFooter - heightHeader; const heightMain = heightA4 - heightFooter - heightHeader;
function px2mm(px1, px2) { function px2mm(px1, px2) {
return (px2 - px1 + 1) * 2.54 / 96 * window.devicePixelRatio * 10; return (px2 - px1 + 1) * 2.54 / 96 * window.devicePixelRatio * 10;
} }
</script> </script>
<script src="file:///@Raw(Model.DataPath)\resources\paged.polyfill.js"></script>
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\style.css"/> <link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\style.css"/>
</head> </head>
<body> <body>
<div class="m1"></div> <div class="m1"></div>
<div class="m2"></div> <div class="m2"></div>
<div class="m3"></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="footer-wrapper">
<div class="pre-footer"> <div class="pre-footer">
<span class="date">@($"{Model.Date:dddd, d. MMMM yyyy}")</span> <span class="date">@($"{Model.Date:dddd, d. MMMM yyyy}")</span>

View File

@ -2,17 +2,28 @@ using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.IO; using System.IO;
using Elwig.Helpers; using Elwig.Helpers;
using System.Text;
namespace Elwig.Documents { namespace Elwig.Documents {
public abstract class Document : IDisposable { public abstract class Document : IDisposable {
private TempFile? PdfFile = null; private TempFile? PdfFile = null;
public string DataPath;
public int CurrentNextSeason;
public string? DocumentId;
public string Title;
public string Author;
public string Header;
public string Footer;
public DateTime Date;
public Document(string title) { public Document(string title) {
var c = App.Client; var c = App.Client;
DataPath = App.DataPath; DataPath = App.DataPath;
CurrentNextSeason = Utils.CurrentNextSeason; CurrentNextSeason = Utils.CurrentNextSeason;
Title = title; Title = title;
Author = App.Client.NameFull;
Header = $"<h1>{c.Name}</h1>"; Header = $"<h1>{c.Name}</h1>";
Footer = Utils.GenerateFooter("<br/>", " \u00b7 ") Footer = Utils.GenerateFooter("<br/>", " \u00b7 ")
.Item(c.NameFull).NextLine() .Item(c.NameFull).NextLine()
@ -33,15 +44,7 @@ namespace Elwig.Documents {
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
public string DataPath { get; set; } private Task<string> Render() {
public int CurrentNextSeason { get; set; }
public string Title { get; set; }
public string Header { get; set; }
public string Footer { get; set; }
public DateTime Date { get; set; }
public string? DocumentId { get; set; }
private async Task<string> Render() {
string name; string name;
if (this is BusinessLetter) { if (this is BusinessLetter) {
name = "BusinessLetter"; name = "BusinessLetter";
@ -50,16 +53,19 @@ namespace Elwig.Documents {
} else { } else {
throw new InvalidOperationException("Invalid document object"); throw new InvalidOperationException("Invalid document object");
} }
return await Html.CompileRenderAsync(name, this); return Render(name);
}
private Task<string> Render(string name) {
return Html.CompileRenderAsync(name, this);
} }
public async Task Generate() { public async Task Generate() {
var pdf = new TempFile("pdf"); var pdf = new TempFile("pdf");
using (var tmpHtml = new TempFile("html")) { using (var tmpHtml = new TempFile("html")) {
await File.WriteAllTextAsync(tmpHtml.FilePath, await Render()); await File.WriteAllTextAsync(tmpHtml.FilePath, await Render(), Encoding.UTF8);
await Pdf.Convert(tmpHtml.FilePath, pdf.FilePath); await Pdf.Convert(tmpHtml.FilePath, pdf.FilePath);
} }
Pdf.UpdateMetadata(pdf.FilePath, Title, App.Client.NameFull);
PdfFile = pdf; PdfFile = pdf;
} }

View File

@ -1,64 +1,45 @@
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows;
using PdfSharp.Pdf.IO;
using PuppeteerSharp;
using Elwig.Helpers; using Elwig.Helpers;
using Elwig.Windows; using Elwig.Windows;
using System.Diagnostics; using System.Diagnostics;
using Balbarak.WeasyPrint;
using System;
using System.IO;
namespace Elwig.Documents { namespace Elwig.Documents {
public static class Pdf { public static class Pdf {
private static readonly string Chromium = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe";
private static readonly string PdfToPrinter = App.ExePath + "PDFtoPrinter.exe"; private static readonly string PdfToPrinter = App.ExePath + "PDFtoPrinter.exe";
private static IBrowser? Browser = null; private static readonly FilesManager WeasyPrintManager = new();
public static bool IsReady => Browser != null; private static string? WeasyPrintPython = null;
private static string? WeasyPrintDir => WeasyPrintManager.FolderPath;
public static bool IsReady => WeasyPrintPython != null && WeasyPrintDir != null;
public static async Task Init(Action evtHandler) { public static async Task Init(Action evtHandler) {
Browser = await Puppeteer.LaunchAsync(new LaunchOptions { if (!WeasyPrintManager.IsFilesExsited()) {
Headless = true, await WeasyPrintManager.InitFilesAsync();
ExecutablePath = Chromium, }
// paged.js uses XHRs to load styles, so this is needed WeasyPrintPython = Path.Combine(WeasyPrintManager.FolderPath, "python.exe");
Args = new[] { "--allow-file-access-from-files" },
});
evtHandler(); evtHandler();
} }
public static async Task Close() {
if (Browser == null) return;
await Browser.CloseAsync();
Browser = null;
}
public static async Task Convert(string htmlPath, string pdfPath) { public static async Task Convert(string htmlPath, string pdfPath) {
if (Browser == null) throw new InvalidOperationException("The puppeteer engine has not been initialized yet"); var p = new Process() { StartInfo = new() {
using var page = await Browser.NewPageAsync(); FileName = WeasyPrintPython,
page.Console += OnConsole; CreateNoWindow = true,
await page.GoToAsync($"file://{htmlPath}"); WorkingDirectory = WeasyPrintDir,
await page.EvaluateFunctionAsync("async () => { await window.PagedPolyfill.preview(); }"); RedirectStandardError = true,
await page.PdfAsync(pdfPath, new() { } };
PreferCSSPageSize = true, p.StartInfo.EnvironmentVariables["PATH"] = "Scripts;gtk3;" + Environment.GetEnvironmentVariable("PATH");
//Format = PaperFormat.A4, p.StartInfo.ArgumentList.Add("scripts/weasyprint.exe");
DisplayHeaderFooter = false, p.StartInfo.ArgumentList.Add("-e");
MarginOptions = new() { p.StartInfo.ArgumentList.Add("utf8");
Top = "0mm", p.StartInfo.ArgumentList.Add(htmlPath);
Right = "0mm", p.StartInfo.ArgumentList.Add(pdfPath);
Bottom = "0mm", p.Start();
Left = "0mm", await p.WaitForExitAsync();
}, var stderr = await p.StandardError.ReadToEndAsync();
}); if (p.ExitCode != 0) throw new Exception(stderr);
}
private static void OnConsole(object? sender, ConsoleEventArgs e) {
MessageBox.Show(e.Message.Text);
}
public static void UpdateMetadata(string path, string title, string author) {
using var doc = PdfReader.Open(path);
doc.Info.Title = title;
doc.Info.Author = author;
doc.Save(path);
} }
public static void Show(TempFile file, string title) { public static void Show(TempFile file, string title) {

View File

@ -14,15 +14,18 @@ body {
.m1, .m2, .m3 { .m1, .m2, .m3 {
height: 0; height: 0;
width: 1cm; width: 10mm;
position: fixed; position: fixed;
left: 0; left: -25mm;
border-top: 1pt solid black; border-top: 0.5pt solid black;
} }
.m1.r, .m2.r, .m3.r {
.m1 {top: 105mm;} left: initial;
.m2 {top: 148.5mm;} right: -20mm;
.m3 {top: 210mm;} }
.m1 {top: 80mm;}
.m2 {top: 123.5mm;}
.m3 {top: 185mm;}
header, .address-wrapper, aside, main { header, .address-wrapper, aside, main {
overflow: hidden; overflow: hidden;
@ -40,7 +43,7 @@ header {
header h1{ header h1{
font-size: 18pt; font-size: 18pt;
margin-top: 1cm; margin-top: 10mm;
} }
.spacing { .spacing {
@ -50,7 +53,7 @@ header h1{
.info-wrapper { .info-wrapper {
width: 100%; width: 100%;
height: 45mm; height: 45mm;
margin: 0 0 8.46mm 0; margin: 0 0 2mm 0;
position: relative; position: relative;
} }
@ -60,52 +63,56 @@ header h1{
margin: 0; margin: 0;
padding: 5mm; padding: 5mm;
position: absolute; position: absolute;
left: 20mm; left: -5mm;
top: 0; top: 0;
display: flex;
flex-direction: column;
justify-content: flex-end;
} }
.address-wrapper .sender { .address-wrapper .sender {
flex: 17.7mm 1 1; height: 4em;
font-size: 8pt; font-size: 8pt;
display: flex; padding: 1em 0;
flex-direction: column;
justify-content: flex-end;
padding-bottom: 2mm;
} }
address { address {
flex: 27.3mm 1 1; height: 5em;
white-space: pre-line; white-space: pre-line;
font-size: 12pt; font-size: 12pt;
font-style: normal; font-style: normal;
} }
table {
width: 100%;
border-collapse: collapse;
table-layout: fixed;
}
table td, table td,
table th { table th {
padding: 0.5mm 1mm; padding: 0.5mm 1mm;
} }
table th {
text-align: center;
}
aside { aside {
height: 40mm; height: 40mm;
width: 75mm; width: 75mm;
margin: 0; margin: 0;
position: absolute; position: absolute;
left: 125mm; left: 100mm;
top: 5mm; top: 5mm;
} }
aside table { aside table {
border-collapse: collapse; border-collapse: collapse;
border: 1pt solid #808080; border: 0.5pt solid #808080;
width: calc(100% - 1cm); width: 65mm;
margin-right: 1cm; margin-right: 10mm;
} }
aside table thead:not(:first-child) tr { aside table thead:not(:first-child) tr {
border-top: 1pt solid #808080; border-top: 0.5pt solid #808080;
} }
aside table thead th { aside table thead th {
@ -124,54 +131,51 @@ aside table tbody th {
} }
main { main {
margin: 8.46mm 20mm 4.23mm 25mm; margin: 2em 0 1em 0;
} }
main :first-child { main > *:first-child {
margin-top: 0; margin-top: 0;
} }
main h1, main p { .main-wrapper h1, .main-wrapper p {
font-size: 12pt; font-size: 12pt;
margin: 1em 0; margin: 1em 0;
text-align: justify; text-align: justify;
} }
main p { .main-wrapper p {
widows: 3; widows: 3;
orphans: 3; orphans: 3;
hyphens: auto; hyphens: manual;
} }
main .date { .main-wrapper .date {
margin-bottom: 2em; margin-bottom: 2em;
text-align: right; text-align: right;
} }
main h1 { .main-wrapper h1 {
margin-bottom: 2em; margin-bottom: 2em;
} }
main p.comment { .main-wrapper p.comment {
font-size: 10pt; font-size: 10pt;
} }
.footer-wrapper { .footer-wrapper {
padding: 0 20mm 0 25mm;
position: running(page-footer); position: running(page-footer);
bottom: 0; width: 165mm;
left: 0;
right: 0;
} }
.pre-footer { .pre-footer {
margin: 1em 0; margin: 1em 0;
font-size: 10pt; font-size: 10pt;
display: flex;
} }
.pre-footer > * { .pre-footer > * {
flex: 5cm 1 1; display: inline-block;
width: 33%;
} }
.pre-footer .date { .pre-footer .date {
@ -185,30 +189,29 @@ main p.comment {
.pre-footer .page { .pre-footer .page {
text-align: right; text-align: right;
float: right;
} }
.pre-fotter .page::after { .pre-footer .page::after {
content: "Seite 1 von 1"; content: "Seite 1 von 1";
} }
footer { footer {
font-size: 10pt; font-size: 10pt;
border-top: 1pt solid black; border-top: 0.5pt solid black;
height: 25mm; height: 25mm;
padding-top: 1mm; padding-top: 1mm;
text-align: center; text-align: center;
} }
table {
width: 100%;
border-collapse: collapse;
table-layout: fixed;
}
table.delivery { table.delivery {
margin-bottom: 5mm; margin-bottom: 5mm;
} }
table.delivery tr:not(.main) {
break-before: avoid;
}
table.delivery th { table.delivery th {
font-weight: normal; font-weight: normal;
font-style: italic; font-style: italic;
@ -237,12 +240,15 @@ table.delivery tr.tight.first td {
padding-bottom: 0; padding-bottom: 0;
} }
/* FIXME update version of WeasyPrint
table.delivery tr.tight:has(+ tr:not(.tight)) td { table.delivery tr.tight:has(+ tr:not(.tight)) td {
padding-bottom: 0.5mm !important; padding-bottom: 0.5mm !important;
} }
*/
table.delivery tr.sum { table.delivery tr.sum {
border-top: 1pt solid black; border-top: 0.5pt solid black;
break-before: avoid;
} }
table.delivery tr.sum td { table.delivery tr.sum td {
@ -295,22 +301,22 @@ table.delivery-stats tbody th {
visibility: hidden; visibility: hidden;
} }
main .bottom { .main-wrapper .bottom {
bottom: 0; bottom: 0;
position: absolute; position: absolute;
width: calc(100% - 25mm - 20mm); width: 165mm;
} }
main .signatures { .main-wrapper .signatures {
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
margin: 20mm 0 2mm 0; margin: 20mm 0 2mm 0;
} }
main .signatures > * { .main-wrapper .signatures > * {
width: 5cm; width: 50mm;
border-top: 1pt solid black; border-top: 0.5pt solid black;
padding-top: 1mm; padding-top: 1mm;
text-align: center; text-align: center;
font-size: 10pt; font-size: 10pt;
@ -318,7 +324,7 @@ main .signatures > * {
hr { hr {
border: none; border: none;
border-top: 1pt solid black; border-top: 0.5pt solid black;
margin: 5mm 0; margin: 5mm 0;
} }
@ -333,7 +339,7 @@ tr.page-break {
@page { @page {
size: A4; size: A4;
margin: 25mm 0 35mm 0; margin: 25mm 20mm 35mm 25mm;
@bottom-center { @bottom-center {
content: element(page-footer); content: element(page-footer);
} }
@ -344,13 +350,13 @@ tr.page-break {
width: 210mm; width: 210mm;
} }
header, .address-wrapper, aside, main { header, .address-wrapper, aside, main {
border: 1pt solid lightgray; border: 1px solid lightgray;
} }
.m1, .m2, .m3 {display: none;} .m1, .m2, .m3 {display: none;}
header {top: 0;} header {top: 0;}
.spacing {height: 45mm;} .spacing {height: 45mm;}
.main-wrapper { .main-wrapper {
margin-bottom: 40mm; margin: 0 20mm 40mm 25mm;
} }
.footer-wrapper { .footer-wrapper {
position: fixed; position: fixed;
@ -365,7 +371,4 @@ tr.page-break {
.page::after { .page::after {
content: "Seite " counter(page) " von " counter(pages); content: "Seite " counter(page) " von " counter(pages);
} }
.footer-wrapper {
display: none;
}
} }

View File

@ -16,14 +16,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Balbarak.WeasyPrint" Version="2.0.2" />
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.5.1" /> <PackageReference Include="Extended.Wpf.Toolkit" Version="4.5.1" />
<PackageReference Include="ini-parser" Version="2.5.2" /> <PackageReference Include="ini-parser" Version="2.5.2" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="6.0.21" /> <PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="6.0.21" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="7.0.10" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="7.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.10" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.10" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1938.49" /> <PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1938.49" />
<PackageReference Include="PdfSharp" Version="1.50.5147" />
<PackageReference Include="PuppeteerSharp" Version="11.0.2" />
<PackageReference Include="RazorLight" Version="2.3.1" /> <PackageReference Include="RazorLight" Version="2.3.1" />
<PackageReference Include="ScottPlot.WPF" Version="4.1.67" /> <PackageReference Include="ScottPlot.WPF" Version="4.1.67" />
<PackageReference Include="System.IO.Ports" Version="7.0.0" /> <PackageReference Include="System.IO.Ports" Version="7.0.0" />

View File

@ -1,6 +1,5 @@
::mkdir "C:\Program Files\Elwig" ::mkdir "C:\Program Files\Elwig"
::curl -s "http://www.columbia.edu/~em36/PDFtoPrinter.exe" -z "C:\Program Files\Elwig\PDFtoPrinter.exe" -o "C:\Program Files\Elwig\PDFtoPrinter.exe" ::curl -s "http://www.columbia.edu/~em36/PDFtoPrinter.exe" -z "C:\Program Files\Elwig\PDFtoPrinter.exe" -o "C:\Program Files\Elwig\PDFtoPrinter.exe"
mkdir "C:\ProgramData\Elwig\resources" mkdir "C:\ProgramData\Elwig\resources"
curl -s -L "https://unpkg.com/pagedjs/dist/paged.polyfill.js" -o "C:\ProgramData\Elwig\resources\paged.polyfill.js" copy /b /y Documents\*.css "C:\ProgramData\Elwig\resources"
copy /b /y "Documents\style.css" "C:\ProgramData\Elwig\resources\style.css"
copy /b /y Documents\*.cshtml "C:\ProgramData\Elwig\resources" copy /b /y Documents\*.cshtml "C:\ProgramData\Elwig\resources"