This code is using a [workaround for PyPDF2](https://stackoverflow.com/a/49927541/336802) for the "empty output file wiht Python 3" issue documented [here](https://github.com/mstamy2/PyPDF2/issues/293).
PyPDF2 is [looking for new maintainers](https://github.com/mstamy2/PyPDF2/issues/385). Once that issue is resolved and a new version is released, the code can be cleaned up by removng the explicit context creation.