Hi all,
I would like to find a way to improve the quality of images using M2Doc Image Services.
It seems that even using vector formats such as SVG, M2Doc instead of relying upon Word native rendering, a conversion of the SVG into a PNG raster is applied, therefore degrading the resolution.
Hi,
For raster images exported from Capella you can change the image quality in the Sirius preferences. Since M2Doc 3.3.3 you can also use options to control the quality from your .genconf
file (see this issue).
For vector images, last time I checked inserting a SVG in a MS Word document created a PNG preview. That might have changed, I didn’t check for a while. But the library M2Doc is using to manipulate OOXML documents doesn’t support SVG insertion (at least with the version of POI we are using). However MS Word support an other vector image format EMF. Unfortunately I didn’t find a Java library that M2Doc could use to convert from SVG to EMF. As a workaround you can write a Java service to do the conversion using Inkscape for instance:
inskscape --export-type="emf" diagram.svg
And yes, at the moment M2Doc convert the SVG to PNG before inserting it in the document.
I just made a check on a simple Word document. The media folder contains both original SVG and rendered PNG files. They are embedded in the w:drawing tag, but it is not clear how they are used in the export and printing process.
Moreover, even using Word advanced settings for best image quality in Options and in Export to PDF, the quality of images in the PDF is rather poor. I don’t know if Adobe Acrobat Pro licence is improving the PDF image quality to a level suitable for publishing.
So far the best path for us was the EMF conversion using inkscape. But even this conversion might not be 100% accurate, but the quality is much better.