diff --git a/Elwig/Documents/BusinessDocument.cshtml.cs b/Elwig/Documents/BusinessDocument.cshtml.cs index 597adf6..ee9036d 100644 --- a/Elwig/Documents/BusinessDocument.cshtml.cs +++ b/Elwig/Documents/BusinessDocument.cshtml.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Elwig.Models; +using Elwig.Models; namespace Elwig.Documents { public abstract class BusinessDocument : Document { diff --git a/Elwig/Documents/BusinessLetter.cshtml.cs b/Elwig/Documents/BusinessLetter.cshtml.cs index 3662ec8..113f1b5 100644 --- a/Elwig/Documents/BusinessLetter.cshtml.cs +++ b/Elwig/Documents/BusinessLetter.cshtml.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Elwig.Models; +using Elwig.Models; namespace Elwig.Documents { public class BusinessLetter : BusinessDocument { diff --git a/Elwig/Documents/Document.cshtml b/Elwig/Documents/Document.cshtml index c5223e8..61f8190 100644 --- a/Elwig/Documents/Document.cshtml +++ b/Elwig/Documents/Document.cshtml @@ -14,8 +14,8 @@ window.addEventListener("afterprint", () => { location.reload(); }); } - - + + @{ await IncludeAsync("Style.css"); }
diff --git a/Elwig/Documents/Document.cshtml.cs b/Elwig/Documents/Document.cshtml.cs index eaec042..85ebe65 100644 --- a/Elwig/Documents/Document.cshtml.cs +++ b/Elwig/Documents/Document.cshtml.cs @@ -1,10 +1,6 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using System.IO; -using System.Windows; using Elwig.Helpers; namespace Elwig.Documents { diff --git a/Elwig/Documents/Pdf.cs b/Elwig/Documents/Pdf.cs index a9432df..16b8bb3 100644 --- a/Elwig/Documents/Pdf.cs +++ b/Elwig/Documents/Pdf.cs @@ -1,17 +1,8 @@ using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Reflection.Metadata.Ecma335; -using System.Text; using System.Threading.Tasks; using System.Windows; -using System.Windows.Shapes; using PdfSharp.Pdf.IO; using PuppeteerSharp; -using PuppeteerSharp.Media; -using RazorLight; using Elwig.Helpers; using Elwig.Windows; @@ -26,6 +17,8 @@ namespace Elwig.Documents { Browser = await Puppeteer.LaunchAsync(new LaunchOptions { Headless = true, ExecutablePath = Chromium, + // paged.js uses XHRs to load styles, so this is needed + Args = new[] { "--allow-file-access-from-files" }, }); evtHandler(); } diff --git a/Elwig/Documents/Style.css.cshtml b/Elwig/Documents/Style.css.cshtml index 0388132..a4b5b0b 100644 --- a/Elwig/Documents/Style.css.cshtml +++ b/Elwig/Documents/Style.css.cshtml @@ -1,5 +1,4 @@ @using RazorLight -@inherits TemplatePage