PyMuPDf issue: https://github.com/pymupdf/PyMuPDF/issues/3278, file "source.pdf" (https://github.com/pymupdf/PyMuPDF/files/14643860/source.pdf) The page /Contents appearance stream will be destroyed if executing mutool clean -c source.pdf
This error obviously has been introduced with MuPDF v1.23.9.
Can replicate only with mutool clean -s source.pdf
Fixed with: commit 779b8234529cb82aa1e92826854c7bb98b19e44b Author: Robin Watts <Robin.Watts@artifex.com> Date: Thu Mar 28 14:21:13 2024 +0000 Bug 707673: Fix text movement on sanitisation. This is actually down to the same kind of issue as seen with bug 707448, in that an unholy combination of negative font height and negative font scale are combining to confuse our positioning code. Once again I've gone through the code attempting to simplify it, and I think I'm happier with this version now. Certainly it seems to get all the files from both bugs correct now. Any further work in this area should check bug 707448 to make sure it still works.