In contrast to page rendering, SVG conversion does not make sure whether any OCGs are valid at all. PyMuPDF Discussion item: https://github.com/pymupdf/PyMuPDF/discussions/3567 File link: https://github.com/user-attachments/files/15791552/dwe1_2.pdf How to reproduce: mutool draw -o test.svg dwe1_2.pdf Compare to: mutool draw -o test.png dwe1_2.pdf Note: The page refers to dozens of OCGs in its /Properties. But there exists no /OCProperties in the file - so all of the OCGs must be treated as non-existent, like it happens in rendering.
I have a fix in review: https://cgit.ghostscript.com/cgi-bin/cgit.cgi/user/robin/mupdf.git/commit/?h=so&id=8a01ae1ca85902adae87fde06e58af9de301a02e The issueis not the /OCProperties not existing, it's a bad interaction between layers and clips in the generated SVG file.
Tor isn't keen on my fix, because it can split layers into more groups that are strictly needed. We have therefore agreed to park my fix for a couple of weeks to see if he can find a formulation he likes better.
Created attachment 25767 [details] Minimized example.