On 11/24/2016 01:56 PM, Thomas Dumm wrote:
I tested the version 1.2.1. Images which were used to statically render objects 
embedded in the DOCX file (e.g. a PowerPoint slide) are now properly linked.


OK.




I read the changes in 1.2.1 and have a question about converting the emf files 
to svg. Can you please give me an example on how I have to feed the 
W2X_IMAGE_CONVERSIONS parameters .emf.svg soffice --headless --convert-to svg 
-–outdir %~po %i to the conversion? Currently I do on Mac OS X:

while read i; do

# edupool SB Personalwesen Ordner
/Users/thomasdumm/Dropbox/Delivros/Applikationen/Tools/w2x-pro-1_2_1/bin/w2x -pu edit.before.remove-styles 
"before-remove-styles.xed" -p edit.do.sections ""  -p edit.inlines.generate-big-small no -p edit.convert-tabs.to-table 
yes -p edit.inlines.convert "c-Strong b" -p edit.blocks.convert "p-QUELIN textarea ! p-TABGAPlef input class='left' ! 
p-TABGAPcen input class='center' ! p-TABGAPrig input class='right' ! p-TitelTeil123 h1 class='numberless' ! p-Titel14Schrift h6 ! 
p-TitelSchrift14 h6 !p-TiteloNr h6 ! p-TitelMuster h6 ! p-TitelSchrift11ohneNr h6 ! p-TitelSchrift12ohneNr h6 ! p-TitelohneNr h6 ! p-Header 
h6 ! p-Caption p class='Caption' ! p-FootnoteText p class='FootnoteText' ! p-Index1 p class='Index1' ! p-TitelAufgabe h6" -p 
transform.style-with-class yes -p transform.discard-index-terms no -p edit.prune.preserve "p-TABGAPlef p-TABGAPrig p-TABGAPcen 
p-QUELIN" -p edit.remove-styles.preserved-classes "p-TABGAPlef p-TABGAPrig p-TABGAPcen p-QUELIN" -p split.split-before-level 
1 -pu edit.finish-styles.custom-styles-url-or-file style.css -o epub1_1 ${i%%.*}.docx ${i%%.*}.epub

done < files.dat

I'm not a shell specialist and it's difficult for me to help you.

W2X_IMAGE_CONVERSIONS is an *environment* *variable* (i.e. like PATH or HOME) documented here:

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




I made the following experiments (1) (2) (3) and (4) on my Linux box:

1) Let's try:

---
export W2X_IMAGE_CONVERSIONS='.emf.svg soffice --headless --convert-to svg -–outdir %~po %i;+'
---

before running:

---
~/src/toxml_tests/mswordhtml/in/misc1> w2x -o xhtml_css misc1.docx /tmp/misc1.html
---

The above environment variable should work, except that LibreOffice says:

---
Unknown option: --outdir
---

which is incorrect, because LibreOffice also says:

---
--convert-to output_file_extension[:output_filter_name[:output_filter_options]] [--outdir output_dir] files
      Batch convert files (implies --headless).
If --outdir is not specified then current working dir is used as output_dir.
      Eg. --convert-to pdf *.doc
          --convert-to pdf:writer_pdf_Export --outdir /home/user *.doc
          --convert-to "html:XHTML Writer File:UTF8" *.doc
          --convert-to "txt:Text (encoded):UTF8" *.doc
---




2) If you want to see all these details, simply add:

---
export W2X_TRACE=image
---




3) Now that we know that "--outdir" is not really supported, we have added this workaround:

---
export W2X_IMAGE_CONVERSIONS='.emf.svg soffice --headless --convert-to svg %i %3B mv "%~rI.svg" %o;+'
---

which reads as: generate the SVG in the current working directory then (%3B=";" but escaped) copy the SVG image generated in current working directory to the output directory.

And it still does not work! This time with the following LibreOffice error message:

---
convert /tmp/misc1_files/image3.emf -> /home/hussein/src/toxml_tests/mswordhtml/in/misc1/image3.svg using filter : draw_svg_Export

Error: Please verify input parameters... (SfxBaseModel::impl_store <file:///home/hussein/src/toxml_tests/mswordhtml/in/misc1/image3.svg> failed: 0xc10)
---




4) If you target PNG rather than SVG, that is,

---
export W2X_IMAGE_CONVERSIONS='.emf.png soffice --headless --convert-to png %i %3B mv "%~rI.png" %o;+'
---

This time it works, but poorly, because the size of the generated PNG is always an A4 page!





Which open office version do you recommend installing if I do not use open 
office otherwise (OpenOffice/LibreOffice:)?

I'm sorry but I don't know.

I used latest LibreOffice on my Linux box and it seems that this program has a lot of bugs related to option "--convert-to".

This is one of the reasons why we have developed our own emf2png, which works *flawlessly*, but only on Windows.



--
XMLmind Word To XML Support List
w2x-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/w2x-support

Reply via email to