I’m trying to export a svg image to microsoft Word using the WordFileImage.
WordFileImage works with a _io.BufferedReader file from path. But when i generate a _io.BufferedReader from svg it won’t work. Returning viktor.errors.InternalError: An unexpected error occurred.
I hope someone can clarify this for me
Using same file format working in the 1st case, not the 2nd.
docs description of neccesary file format:
I have quickly checked this and the image processing library we use (Pillow) does not support SVG. This is not well documented on our side, we will have to update this.
A solution would be to convert your svg to png, I think there should be libraries out there that may help you. Another possibility would be for
gef_visualization to provide a PNG export as well, however this is not yet possible.
Thanks for your quick reply!
The world file templater seems to have problems with any SVG to PNG converter package. We’ve installed several packages in which we tried to convert the SVG to a PNG BytesIO readable file. We succeeded in creating PNG files, images which we could open with microsoft photos. But we could not succeed in reading the “created” image in the world file tag. An converted PNG with an online tool was readable with the written code. So we are a clueless on what we can do now.