Philippe Nobili wrote: > > It frequently that our DocBook documents reference SVG graphics > embedding bitmaps (e.g. to add annotations to whatever screenshots). > When this happens, the bitmas referenced in the SVG file are not copied > with other resources (from xslMenu.incl), for example: > > <mediaobject><imageobject><imagedata fileref="images/mygraphics.svg" > /></imageobject> > > mygraphic.svg will be copied, but not the mygraphics.jpg it references: > <image id="image1557" xlink:href="mygraphics.jpg"/> > > leading to the following error messages during FOP PDF conversion (excerpt): > > [FOP ERROR] Error while opening file. > Could not load image from system identifier > 'file:/tmp/xxe917718694241510695/resources/mygraphics.jpg' > (/tmp/xxe917718694241510695/resources/mygraphics.jpg (No such file or > directory)) > [ > > And the image is of course missing on the produced PDF file. > > So far, we could not find any convenient way to fix this issue, apart > from using absolute paths in the SVG files -- which is not very > practical --, or converting the SVG graphics into bitmaps -- which > looses the advantage of using SVG...---. Is there a way to detect these > "hidden" resources before document conversion (i.e. in xslMenu.incl)
Yes, if you embed the SVG in the XML document: use configuration element documentResources (http://www.xmlmind.com/xmleditor/_distrib/doc/configure/documentResources.html). No, if you just reference an external SVG file. > and copy them into the temporary working directory with all other > resources before running the actual XSL conversion ? > We used to support references to SVG graphics themselves referencing external files in v3 (including in File|Save As) and we definitely removed this feature because its implementation was much too complicated given its usefulness. You need to use an SVG editor which allows you to embed external files in the SVG by the means of a "data:" URI (http://www.ietf.org/rfc/rfc2397.txt). Actual example (excerpt of a SVG file generated by Inkscape): --- <image xlink:href="data:image/png;base64,iVBOR ... mjBbbCcAAAA AElFTkSuQmCC " x="60.840504" y="62.153378" width="127" height="28" id="image2591" /> --- FOP, Batik, XEP all support "data:" URI. (Very) Recent versions of Inkscape (http://www.inkscape.org/) allow to do this simply by using an option (Effects|Images|Embed All Images -- http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Effects-Images.html#Effects-EmbedAllImages). We use this Inkscape feature for our own needs.

