Skip to content

Commit 96aa68c

Browse files
committed
tests/test_general.py: fix expected svg output in test_3569 from MuPDF 1.27.x.
1 parent 57bf2bc commit 96aa68c

File tree

1 file changed

+50
-24
lines changed

1 file changed

+50
-24
lines changed

tests/test_general.py

Lines changed: 50 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,30 +1632,56 @@ def test_3569():
16321632
page = document[0]
16331633
svg = page.get_svg_image(text_as_path=False)
16341634
print(f'{svg=}')
1635-
assert svg == (
1636-
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" width="3024" height="2160" viewBox="0 0 3024 2160">\n'
1637-
'<defs>\n'
1638-
'<clipPath id="clip_1">\n'
1639-
'<path transform="matrix(0,-.06,-.06,-0,3024,2160)" d="M25432 10909H29692V15642H25432V10909"/>\n'
1640-
'</clipPath>\n'
1641-
'<clipPath id="clip_2">\n'
1642-
'<path transform="matrix(0,-.06,-.06,-0,3024,2160)" d="M28526 38017 31807 40376V40379L31312 41314V42889H28202L25092 42888V42887L28524 38017H28526"/>\n'
1643-
'</clipPath>\n'
1644-
'</defs>\n'
1645-
'<g clip-path="url(#clip_1)">\n'
1646-
'<g inkscape:groupmode="layer" inkscape:label="CED - Text">\n'
1647-
'<text xml:space="preserve" transform="matrix(.06 0 0 .06 3024 2160)" font-size="174.644" font-family="ArialMT"><tspan y="-28538" x="-14909 -14841.063 -14773.127 -14676.024 -14578.922 -14520.766 -14423.663">**L1-13</tspan></text>\n'
1648-
'</g>\n'
1649-
'</g>\n'
1650-
'<g clip-path="url(#clip_2)">\n'
1651-
'<g inkscape:groupmode="layer" inkscape:label="Level 03|S-COLS">\n'
1652-
'<path transform="matrix(0,-.06,-.06,-0,3024,2160)" d="M31130 41483V42083L30530 41483ZM31130 42083 30530 41483V42083Z" fill="#7f7f7f"/>\n'
1653-
'<path transform="matrix(0,-.06,-.06,-0,3024,2160)" stroke-width="0" stroke-linecap="butt" stroke-miterlimit="10" stroke-linejoin="miter" fill="none" stroke="#7f7f7f" d="M31130 41483V42083L30530 41483ZM31130 42083 30530 41483V42083Z"/>\n'
1654-
'<path transform="matrix(0,-.06,-.06,-0,3024,2160)" stroke-width="9" stroke-linecap="round" stroke-linejoin="round" fill="none" stroke="#7f7f7f" d="M30530 41483H31130V42083H30530V41483"/>\n'
1655-
'</g>\n'
1656-
'</g>\n'
1657-
'</svg>\n'
1658-
)
1635+
if pymupdf.mupdf_version_tuple >= (1, 27):
1636+
assert svg == (
1637+
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" width="3024" height="2160" viewBox="0 0 3024 2160">\n'
1638+
'<defs>\n'
1639+
'<clipPath id="clip_1">\n'
1640+
'<path transform="matrix(0,-.06,-.06,-0,3024,2160)" d="M25432 10909H29692V15642H25432V10909"/>\n'
1641+
'</clipPath>\n'
1642+
'<clipPath id="clip_2">\n'
1643+
'<path transform="matrix(0,-.06,-.06,-0,3024,2160)" d="M28526 38017 31807 40376V40379L31312 41314V42889H28202L25092 42888V42887L28524 38017H28526"/>\n'
1644+
'</clipPath>\n'
1645+
'</defs>\n'
1646+
'<g clip-path="url(#clip_1)">\n'
1647+
'<g inkscape:groupmode="layer" inkscape:label="CED - Text">\n'
1648+
'<text xml:space="preserve" transform="matrix(.06 0 0 .06 3024 2160)" font-size="174.644" font-family="ArialMT"><tspan y="-28538" x="-14909 -14841.063 -14773.127 -14676.024 -14578.922 -14520.766 -14423.663">**L1-13</tspan></text>\n'
1649+
'</g>\n'
1650+
'</g>\n'
1651+
'<g clip-path="url(#clip_2)">\n'
1652+
'<g inkscape:groupmode="layer" inkscape:label="Level 03|S-COLS">\n'
1653+
'<path transform="matrix(0,-.06,-.06,-0,3024,2160)" d="M31130 41483V42083L30530 41483ZM31130 42083 30530 41483V42083Z" fill="#7f7f7f"/>\n'
1654+
'<path transform="matrix(0,-.06,-.06,-0,3024,2160)" stroke-linecap="butt" stroke-miterlimit="10" stroke-linejoin="miter" fill="none" stroke="#7f7f7f" d="M31130 41483V42083L30530 41483ZM31130 42083 30530 41483V42083Z"/>\n'
1655+
'<path transform="matrix(0,-.06,-.06,-0,3024,2160)" stroke-width="9" stroke-linecap="round" stroke-linejoin="round" fill="none" stroke="#7f7f7f" d="M30530 41483H31130V42083H30530V41483"/>\n'
1656+
'</g>\n'
1657+
'</g>\n'
1658+
'</svg>\n'
1659+
)
1660+
else:
1661+
assert svg == (
1662+
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" width="3024" height="2160" viewBox="0 0 3024 2160">\n'
1663+
'<defs>\n'
1664+
'<clipPath id="clip_1">\n'
1665+
'<path transform="matrix(0,-.06,-.06,-0,3024,2160)" d="M25432 10909H29692V15642H25432V10909"/>\n'
1666+
'</clipPath>\n'
1667+
'<clipPath id="clip_2">\n'
1668+
'<path transform="matrix(0,-.06,-.06,-0,3024,2160)" d="M28526 38017 31807 40376V40379L31312 41314V42889H28202L25092 42888V42887L28524 38017H28526"/>\n'
1669+
'</clipPath>\n'
1670+
'</defs>\n'
1671+
'<g clip-path="url(#clip_1)">\n'
1672+
'<g inkscape:groupmode="layer" inkscape:label="CED - Text">\n'
1673+
'<text xml:space="preserve" transform="matrix(.06 0 0 .06 3024 2160)" font-size="174.644" font-family="ArialMT"><tspan y="-28538" x="-14909 -14841.063 -14773.127 -14676.024 -14578.922 -14520.766 -14423.663">**L1-13</tspan></text>\n'
1674+
'</g>\n'
1675+
'</g>\n'
1676+
'<g clip-path="url(#clip_2)">\n'
1677+
'<g inkscape:groupmode="layer" inkscape:label="Level 03|S-COLS">\n'
1678+
'<path transform="matrix(0,-.06,-.06,-0,3024,2160)" d="M31130 41483V42083L30530 41483ZM31130 42083 30530 41483V42083Z" fill="#7f7f7f"/>\n'
1679+
'<path transform="matrix(0,-.06,-.06,-0,3024,2160)" stroke-width="0" stroke-linecap="butt" stroke-miterlimit="10" stroke-linejoin="miter" fill="none" stroke="#7f7f7f" d="M31130 41483V42083L30530 41483ZM31130 42083 30530 41483V42083Z"/>\n'
1680+
'<path transform="matrix(0,-.06,-.06,-0,3024,2160)" stroke-width="9" stroke-linecap="round" stroke-linejoin="round" fill="none" stroke="#7f7f7f" d="M30530 41483H31130V42083H30530V41483"/>\n'
1681+
'</g>\n'
1682+
'</g>\n'
1683+
'</svg>\n'
1684+
)
16591685
wt = pymupdf.TOOLS.mupdf_warnings()
16601686
assert wt == 'unknown cid collection: PDFAUTOCAD-Indentity0\nnon-embedded font using identity encoding: ArialMT (mapping via )\ninvalid marked content and clip nesting'
16611687

0 commit comments

Comments
 (0)