Jeff Hooker wrote:
> 
> I'm trying to add an image addon that will render PDF images as PNG files 
> withing XMLmind. I've basically cut and pasted the ghostscript-based addon 
> found in the Configure.pdf. However, my users don't have ghostscript 8, so 
> I've packaged it as a part of the addon and need to add it to user computer's 
> PATH statement dynamically.
> 
> However, when I make two shell elements, the effect is that two different 
> shells are opened, and the path declared in the first is not valid in the 
> second:
> 
> <shellcommand="path = %PATH%;D:\Program 
> Files\XMLmind_XML_Editor4.2Pro\addon\gs\gs8.63\bin"platform
> <shellcommand
> -r96 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dEPSCrop
> %A &quot;-sOutputFile=%O&quot; &quot;%I&quot;"="gswin32c -q -dBATCH -dNOPAUSE 
> -sDEVICE=png16mplatform
>  
> Is there any way of passing two commands to the same shell in this context?

There is a much simpler (and much more reliable) way to do that.
Directly refer to the directory containing the configuration file
specifying the image toolkit (i.e. the directory where the add-on has
been installed).

Example:

---
<imageToolkit name="TeX Math">
  <description>Converts TeX mathematics to PNG, EPS, PDF.
Important: requires Ghostscript 8+.</description>

  <converter>
    <!-- First line of the TeX file must be "%tex" if you want to be
able to embed base64-encoded ``TeX images'' in your documents. -->

    <input extensions="tex" magicStrings="%tex"/>
    <output extensions="png eps ps pdf"/>

    <shell command='"%C%Stexmathtoimg" "%I" "%O"' platform="Unix"/>

    <shell command='call "%C%Stexmathtoimg.bat" "%I" "%O"'
           platform="Windows"/>
  </converter>
</imageToolkit>
---

Notice how using "%C", the imagetoolkit invokes texmathtoimg.bat
contained in the directory where the add-on has been installed. You
could to the same to directly invoke gswin32c:

%C\gs\gs8.63\bin\gswin32c

More information in
http://www.xmlmind.com/xmleditor/_distrib/doc/configure/imageToolkit.html





Reply via email to