mirror of
https://codeberg.org/angestoepselt/imagestack.git
synced 2026-03-21 22:32:17 +00:00
18 lines
390 B
Python
18 lines
390 B
Python
import typst
|
|
import json
|
|
|
|
|
|
|
|
def compile_pdf(data: dict, batch=False):
|
|
data = {"computer": json.dumps(data)}
|
|
if batch==True:
|
|
temp = "files/batch.typ"
|
|
else:
|
|
temp = "files/main.typ"
|
|
try:
|
|
res = typst.compile(input=temp, sys_inputs=data)
|
|
except RuntimeError as e:
|
|
print(e)
|
|
print("Error compiling")
|
|
return False
|
|
return(res)
|