Jay, the patch looks good to me. I did not try to run it, but it looks like it covers everything important.
Sean, there is no license change to pikepdf. ocrmypdf did have the license change. If this is the holdup, ocrmypdf 10.x should work pikepdf 2.x with a trivial patch - the main change in pikepdf 2.x was dropping support for Python 3.5. If you are interested in the ocrmypdf 10.x + pikepdf 2.x combination I can test it and do any patches. pikepdf is now used by other applications in Debian (e.g. pdfarranger). ocrmypdf 11's d/copyright was updated to reflect the current copyright status. It's been half a year since the ocrmypdf license change and I have not heard anything from Debian about it. Is there a "queue" somewhere or someone we can prod to complete this review? Thanks for your help, James