No illustrations in Word generated document

Post here questions and problems related to editing and publishing DITA content.
LASSE_MLE
Posts: 7
Joined: Mon Dec 05, 2022 3:24 pm

No illustrations in Word generated document

Post by LASSE_MLE »

Hi all,

In our validation process, we want to generate docx file so that reviewers can validate (and eventually modify) the documents.
Our main output are PDF and HTML but for the review, MS Word may be easier to use (for reviewers that do not have Oxygen licenses).
Our first test with very basic document was correct but the document I generate this morning has illustrations (*.svg) and these illustrations did not appear in the MS Word document.
I used the default DITA Map MS Office Word transformation scenario. I also tried to modify it, adding the path of Inkscape in the inkscape.exec parameter without anything better.
Do you have a idea on how to get the pictures in the generated document?
Thank you in advance for your help,
ML

<oXygen/> XML Editor 24.1, build 2022030807
Radu
Posts: 8408
Joined: Fri Jul 09, 2004 5:18 pm

Re: No illustrations in Word generated document

Post by Radu »

Hi,

You cannot embed the SVGs directly inside the Word document.
So you have this alternative you tried of setting the inkscape.exec parameter in order to convert on the fly SVG to EMF while publishing to Word.
On my side I downloaded Inkscape 1.2.1 and set the inkscape.exec parameter to point to C:\Users\my_user_name\Downloads\inkscape-1.2.1\bin\inkscape.exe.
Then I also needed to modify this build file "OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT3.x/plugins/com.elovirta.ooxml/build.xml" and make the changes I proposed here:
https://github.com/jelovirt/com.elovirt ... /issues/98

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
LASSE_MLE
Posts: 7
Joined: Mon Dec 05, 2022 3:24 pm

Re: No illustrations in Word generated document

Post by LASSE_MLE »

Thank you very much Radu for your answer.
I will try your fix and keep you posted!
ML
LASSE_MLE
Posts: 7
Joined: Mon Dec 05, 2022 3:24 pm

Re: No illustrations in Word generated document

Post by LASSE_MLE »

Radu,
Thank you so much! It works like a charm!
Just one issue, modifying the build.xml file convert all the SVG of my project in EMF. It works but it takes more than 20' for a 5 pages document and this document raises 200Mo! The document I want to convert is in the middle of a big project with more than 50 different documents...
Did you have an idea on how to force it to convert only the SVG needed?
I tried to change the path>fileset>include parameter:

Code: Select all

  <target name="docx.svg2emf" if="inkscape.exec" unless="docx.inkscape.skip">
    <mkdir dir="${dita.temp.dir}/docx/word/media"/>
    <for param="svg.file">
      <path>
        <fileset dir="${user.input.dir}">
          <include name="**/20*.svg"/> <!-- to convert only the 20***.svg files -->
        </fileset>
      </path>
It convert only the files I have filtered but this filter is a bit violent. And I do not understand how to filter with the SVG embeded only in the topics contained in the ditamap I am converting...
Hope you can help me... Sorry, I'm a technical writer and definitely not a specialist of the publication part :(
ML
Radu
Posts: 8408
Joined: Fri Jul 09, 2004 5:18 pm

Re: No illustrations in Word generated document

Post by Radu »

Hi,

It's hard without knowing the exact project structure you have but...
Are the SVG images referenced using direct references <image href> or indirect <image keyref> references?
If you publish for example the DITA Map to HTML are all the images also copied to the output folder?
Do you have a DITA Map which refers to only a few DITA topics, right? Is it possible those few DITA topics refer to other topics which in turn refer to others? In this case the publishing engine might navigate the entire graph of references and collect referenced image paths from all directly and indirectly referenced topics.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
LASSE_MLE
Posts: 7
Joined: Mon Dec 05, 2022 3:24 pm

Re: No illustrations in Word generated document

Post by LASSE_MLE »

Hi Radu,
SVG are referenced using href...
Publishing in HTML leads to a different situation, all the SVG are not copied but there is a mass of other topic absolutely not related that are present.
Pretty sure you're right and there is one topic that reference something that create all these dependencies... As I am not the writer of the common/generic topics, I have to analyse the situation.
But you help me clarifying the issue!
Thank you again,
ML
Post Reply