Add Utils.RunBackground

This commit is contained in:
2023-03-09 23:02:54 +01:00
parent 54ba861b0e
commit 483657911d
4 changed files with 18 additions and 12 deletions

View File

@ -39,7 +39,7 @@ namespace WGneu.Documents {
if (Browser == null) throw new InvalidOperationException("The puppeteer engine has not been initialized yet");
using var page = await Browser.NewPageAsync();
page.Console += OnConsole;
await page.GoToAsync("file://" + htmlPath);
await page.GoToAsync($"file://{htmlPath}");
await page.EvaluateFunctionAsync("async () => { await window.PagedPolyfill.preview(); }");
await page.PdfAsync(pdfPath, new() {
PreferCSSPageSize = true,