diff --git a/namensschild.html b/namensschild.html index dd39b05..8dd3cd3 100644 --- a/namensschild.html +++ b/namensschild.html @@ -23,21 +23,20 @@
Kein Name
diff --git a/server.py b/server.py index 1864209..86c88a6 100755 --- a/server.py +++ b/server.py @@ -17,7 +17,7 @@ async def gen_pdf(name): browser = await launch(args=["--no-sandbox"]) page = await browser.newPage() await page.goto("file://" + os.path.join(os.getcwd(), "namensschild.html")) - await page.evaluate(f"document.querySelector('#name').innerText = '{name}'") + await page.evaluate(f"setName('{name}')") await page.pdf(path=f"static/{name}.pdf", width="180px", height="60px") await browser.close()