10 lines
195 B
Python
10 lines
195 B
Python
import tempfile
|
|
from contextlib import contextmanager
|
|
|
|
|
|
@contextmanager
|
|
def temporary_pdf_file(pdf: bytes):
|
|
with tempfile.NamedTemporaryFile() as f:
|
|
f.write(pdf)
|
|
yield f.name
|