Make use of context managers to write slightly cleaner code for both PDFDocuments and SimplePDFViewers. Currently this is not supported and AttributeError: __enter__ is displayed as it is not implemented yet.
Intended usage
with PDFDocument(open('filepath', 'rb')) as doc:
print(doc.header.version)
Current usage
with open('filepath', 'rb') as pdf:
doc = PDFDocument(pdf)
print(doc.header.version)
Description
Make use of context managers to write slightly cleaner code for both PDFDocuments and SimplePDFViewers. Currently this is not supported and
AttributeError: __enter__
is displayed as it is not implemented yet.Intended usage
Current usage