forked from python-openxml/python-docx
-
Notifications
You must be signed in to change notification settings - Fork 0
Phase D.22: SVG image support #35
Copy link
Copy link
Open
Labels
Description
Add support for inserting SVG images into documents.
Challenges
- Word uses a dual representation: SVG in mc:AlternateContent with a PNG/EMF fallback
- The SVG is stored as a separate part (image/svg+xml)
- The fallback raster image must be generated or provided by the caller
API Design
- document.add_picture(svg_path) — detect SVG, create both SVG part and fallback
- Options: provide explicit fallback image, or auto-generate using cairosvg/rsvg if available
- InlineShape.image should return the SVG data when the image is an SVG
XML
mc:AlternateContent > mc:Choice (with a16sv3:svgBlip) + mc:Fallback (with standard a:blip to raster)
Upstream: python-openxml#351, python-openxml#651, python-openxml#798 (12+8+6 = 26 comments)
Reactions are currently unavailable