Fabián M. wrote:

We need to convert WMF images in docx files to SVG, we've upgraded w2x
to latest one (1.5.0 as of 2018-06-18).

I've read the docs at:

http://www.xmlmind.com/w2x/_distrib/doc/manual/webhelp5/extension_points.html#W2X_IMAGE_CONVERSIONS

and cannot figure out what I need to do to have the WMF images in the
docx file output as SVG images... I've set the W2X_IMAGE_CONVERSIONS
environment variable to ".wmf.svg
java:com.xmlmind.w2x_ext.wmf_converter.WMFConverterFactory;.tiff.png
java:com.xmlmind.w2x.docx.image.ImageConverterFactoryImpl", does not work...

I've tried to put System.setProperty("W2X_IMAGE_CONVERSIONS",
".wmf.svg....") on the Servlet's init(), nothing...


There is nothing special to do or to declare to convert WMF graphics to SVG.

The doc (http://www.xmlmind.com/w2x/_distrib/doc/manual/webhelp5/extension_points.html#W2X_IMAGE_CONVERSIONS) says:
--
The default value of this variable is (all specifications on a single line):

.wmf.svg java:com.xmlmind.w2x_ext.wmf_converter.WMFConverterFactory;
.tiff.png java:com.xmlmind.w2x.docx.image.ImageConverterFactoryImpl

On Windows, the default value of W2X_IMAGE_CONVERSIONS is (all specifications on a single line):

.wmf.svg java:com.xmlmind.w2x_ext.wmf_converter.WMFConverterFactory;
.emf.png.wmf.png java:com.xmlmind.w2x_ext.emf2png.EMF2PNG resolution 0;
.tiff.png java:com.xmlmind.w2x.docx.image.ImageConverterFactoryImpl
---

which means that our WMFConverterFactory tool used to convert WMF To SVG is automatically predeclared on all platforms.

I've re-tested this feature with the following distribution (first running Java 8 then Java 10)

w2x_servlet-pro-1_5_0.zip

and also with our online conversion service (running Java 7 on our server)

http://www.xmlmind.com/w2x/docx_to_dita.html

and it works fine in all cases.




--> Some ideas though:

1) Make sure that wmf_converter.jar and wmf2svg.jar are found in your w2x/WEB-INF/lib/

---
/opt/apache-tomcat-9.0.7/webapps$ ls w2x/WEB-INF/lib/
emf2png-32.dll  jai_imageio.jar   saxon.jar     w2x_rt.jar wmf_converter.jar
emf2png-64.dll  multipartreq.jar  snowball.jar  whc.jar
emf2png.jar     resolver.jar      w2x.jar       wmf2svg.jar
---

2) Make sure that you are not confusing WMF and EMF. (EMF is much more common than older WMF.)

As written in the above doc, WMF may be converted to SVG on all platforms and EMF may converted to PNG but only on Windows.

3) May be the WMF graphics you have in your DOCX document cause our WMFConverterFactory tool to fail.

You may want to test your DOCX using our online conversion service:

http://www.xmlmind.com/w2x/online_w2x.html

If your DOCX actually contains WMF graphics (and not EMF graphics) and you don't get SVG files, please send us privately your DOCX file because in such case, it's almost certainly a bug or limitation in our WMFConverterFactory tool.

--
XMLmind Word To XML Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/w2x-support

Reply via email to