File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -1949,7 +1949,7 @@ def get_acroform(doc):
19491949 parents [xref ]["new_xref" ] = parent_xref_new
19501950 parents [xref ]["new_kids" ] = kids_xrefs_new
19511951
1952- for i in src_range :
1952+ for i in range ( len ( src_range )) :
19531953 # read first copied over page in target
19541954 tar_page = tar [start_at + i ]
19551955
Original file line number Diff line number Diff line change @@ -298,3 +298,19 @@ def test_merge_checks2():
298298
299299 assert len (set (names0 + names1 )) == len (names2 )
300300 assert kids2 == dup_kids
301+
302+
303+ test_4412_path = os .path .normpath (f'{ __file__ } /../../tests/resources/test_4412.pdf' )
304+
305+ def test_4412 ():
306+ # This tests whether a page from a PDF containing widgets found in the wild
307+ # can be inserted into a new document with default options (widget=True)
308+ # and widget=False.
309+ print ()
310+ for widget in True , False :
311+ print (f'{ widget = } ' , flush = 1 )
312+ with pymupdf .open (test_4412_path ) as doc , pymupdf .open () as new_doc :
313+ buf = io .BytesIO ()
314+ new_doc .insert_pdf (doc , from_page = 1 , to_page = 1 )
315+ new_doc .save (buf )
316+ assert len (new_doc )== 1
You can’t perform that action at this time.
0 commit comments