The W2X_IMAGE_CONVERSIONS environment variable is for use by w2x and w2x-app programs. Notice in <W2X_install_dir>/bin/w2x:

---
exec "$java" -DW2X_TRACE="$W2X_TRACE" \
    -DW2X_IMAGE_CONVERSIONS="$W2X_IMAGE_CONVERSIONS" \
    -DW2X_MATH_CONVERTER_XSLT="$W2X_MATH_CONVERTER_XSLT" \
    -Djava.awt.headless=true -classpath "$cp" \
    com.xmlmind.w2x.processor.Start "$@"
---

This indicates that W2X_IMAGE_CONVERSIONS environment variable is just a "cover" for the W2X_IMAGE_CONVERSIONS system property.

So please pass the W2X_IMAGE_CONVERSIONS system property to the w2x servlet by any mean you'll find. (This must be done at an early stage before the code of w2x is loaded.)

While at it, also pass -DW2X_TRACE=image

Also please invoke "soffice" using an absolute path; just to be sure.



---
PS: With my LibreOffice v5.0, on my Linux box,

soffice --headless --convert-to svg --outdir /tmp vector-graphics-butterfly.emf

does not work. Which version are you using?






On 05/07/2019 05:34 PM, Fabián Mandelbaum wrote:

I've setup the following environment variable on my system (Ubuntu Linux
18.04 LTS):

$ export | grep W2X
declare -x W2X_IMAGE_CONVERSIONS=".emf.svg soffice --headless
--convert-to svg -–outdir %~po %i;+"
fabman@andromeda:~$

Using the w2x 1.7.0 'stock' servlet, I send a docx file (attached) that
has an EMF image, and try to convert to HTML+CSS (Whatever the first
option in the pulldown for output format is, I don't change it).

The resulting zip file (also attached) contains the EMF image, and not
the SVG conversion

I've also tried setting the above in the bin/setenv.sh script of my
Tomcat deployment, same result, EMF in ZIP, instead of its SVG conversion.

Read 
https://www.xmlmind.com/w2x/_distrib/doc/manual/index.html#W2X_IMAGE_CONVERSIONS,
but cannot find a clear indication of where to set W2X_IMAGE_CONVERSION,
and above attempts all fail.

BTW, running the 'soffice --headless...' command on the CLI does convert
an EMF (attached) file to SVG (attached)


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

Reply via email to