Small fixes

This commit is contained in:
2023-03-05 03:00:13 +01:00
parent 342c7b92bd
commit 7416c03b92
3 changed files with 52 additions and 42 deletions

View File

@ -14,7 +14,7 @@ namespace WGneu.Print {
private static readonly string CHROMIUM = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe";
private static IBrowser? Browser = null;
public static async void Init() {
public static async Task Init() {
Browser = await Puppeteer.LaunchAsync(new LaunchOptions {
Headless = true,
ExecutablePath = CHROMIUM,
@ -23,7 +23,7 @@ namespace WGneu.Print {
public static async Task Convert(string path_html, string path_pdf) {
if (Browser == null)
Init();
await Init();
using var page = await Browser?.NewPageAsync();
await page.GoToAsync("file://" + path_html);