Add pdf helper -> save temporary file to pdf

This commit is contained in:
Richard Kubíček
2025-01-25 19:15:42 +01:00
parent 6ce895a5e1
commit 4edf8fd84c

View File

@@ -0,0 +1,10 @@
import tempfile
from typing import IO
def save_temporary_file_as_pdf(
temp_file: IO[bytes], output_path: str = "output.pdf"
) -> None:
with open(output_path, "wb") as f:
f.write(temp_file.read())
temp_file.close()