You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys! Thanks for your great work! It seems that word has been providing support for svg for a couple of years now. I have tried adding an svg file using add_image but I get the following error message:
docx.image.exceptions.UnrecognizedImageError.
I was wondering if you were planning to add support to svgs in the near future. I also tried adding the svg by manipulating the xmls, but I could not make it work either. It was a little too complicated for me. Thanks again!!
I don't believe Word supports SVG natively. What I believe it does is translate the SVG to EMF (Windows Meta File/Extended Meta File) format and embed that. Since EMF is a vector format, it looks just like the SVG.
The problem is that there is no SVG to EMF translator available in Python, at least the last time I looked. So this functionality (which would also be desirable for python-pptx) is not feasible at the moment.
I'm working in MS Word 2016, as you surely know you can add a svg picture. I have unzipped the Word document to see how they manipulate this kind of files, then i realize that the xml drawing node is very similar for a svg/png. and in the media folder the svg is saved as it without changes, and all the references in the relationship file are to the svg.
So (and this is my supposition) it is technically possible give support to this without convertions.
If i can help you in anything let me know.
Reacted by Joseph Fox-Rabinovitz, Daniel Prata Vieira, Guy De Pauw, Shay Tsadok, timetheoretical, cslotboom, bresait and Pan Kotsias
It would be really awesome if this could be done. Word (and other Office applications) now support SVG natively (they're now imported as editable vector images).
Agree that I'd like to see this feature. I am deploying code that uses this library, so it is difficult for us to use a branch, Would love to see #1343 approved/merged.
Activity
scanny commentedon Apr 3, 2019
I don't believe Word supports SVG natively. What I believe it does is translate the SVG to EMF (Windows Meta File/Extended Meta File) format and embed that. Since EMF is a vector format, it looks just like the SVG.
The problem is that there is no SVG to EMF translator available in Python, at least the last time I looked. So this functionality (which would also be desirable for
python-pptx) is not feasible at the moment.kndidox commentedon Apr 3, 2019
Hi @scanny thanks for your quick answer.
I'm working in MS Word 2016, as you surely know you can add a svg picture. I have unzipped the Word document to see how they manipulate this kind of files, then i realize that the xml drawing node is very similar for a svg/png. and in the media folder the svg is saved as it without changes, and all the references in the relationship file are to the svg.
So (and this is my supposition) it is technically possible give support to this without convertions.
If i can help you in anything let me know.
jtchen2k commentedon Apr 6, 2020
I'm using Office 365 and I'm sure that Word supports svg format. Encountering the same issue, hope it can be fixed soon.
ftomassetti commentedon Jul 30, 2020
Is this a duplicate of #505 ?
ftomassetti commentedon Jul 30, 2020
And of #351
rgoubet commentedon Apr 22, 2021
It would be really awesome if this could be done. Word (and other Office applications) now support SVG natively (they're now imported as editable vector images).
contang0 commentedon Aug 30, 2021
Would love to see this feature as well.
Add basic support for adding SVG pictures to docx files
Add basic support for adding SVG pictures to docx files
Add basic support for adding SVG pictures to docx files
michaelarfreed commentedon Apr 24, 2024
Agree that I'd like to see this feature. I am deploying code that uses this library, so it is difficult for us to use a branch, Would love to see #1343 approved/merged.
Add basic support for adding SVG pictures to docx files
Add basic support for adding SVG pictures to docx files