File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -2082,3 +2082,31 @@ def test_4590():
20822082 # Check pymupdf.Document.scrub() works.
20832083 with pymupdf .open (path ) as document :
20842084 document .scrub ()
2085+
2086+
2087+ def test_4702 ():
2088+ path = util .download (
2089+ 'https://github.com/user-attachments/files/22403483/01995b6ca7837b52abaa24e38e8c076d.pdf' ,
2090+ 'test_4702.pdf' ,
2091+ )
2092+ with pymupdf .open (path ) as document :
2093+ for xref in range (1 , document .xref_length ()):
2094+ print (f'{ xref = } ' )
2095+ try :
2096+ _ = document .xref_object (xref )
2097+ except Exception as e1 :
2098+ print (f'{ e1 = } ' )
2099+ try :
2100+ document .update_object (xref , "<<>>" )
2101+ except Exception as e2 :
2102+ print (f'{ e2 = } ' )
2103+ raise
2104+ wt = pymupdf .TOOLS .mupdf_warnings ()
2105+ assert wt == 'repairing PDF document'
2106+
2107+ with pymupdf .open (path ) as document :
2108+ for xref in range (1 , document .xref_length ()):
2109+ print (f'{ xref = } ' )
2110+ _ = document .xref_object (xref )
2111+ wt = pymupdf .TOOLS .mupdf_warnings ()
2112+ assert wt == 'repairing PDF document'
You can’t perform that action at this time.
0 commit comments