how can i start/open a pdf temporaryfile? Or is it possible to start/open a pdf wrote in memory?
Here is my code:
"""python
import PyPDF2, tempfile, subprocess
reader = PyPDF2.PdfReader("example.pdf")
writer = PyPDF2.PdfWriter()
for p in reader.pages:
writer.add_page(p)
tmpf = tempfile.NamedTemporaryFile(dir=".",suffix="sample.pdf")
with open(tmpf.name,"wb") as test:
print(tmpf.name)
writer.write(test)
subprocess.call(("xdg-open",tmpf.name))
"""