how to add images?

Having trouble installing Oxygen? Got a bug to report? Post it all here.
malibusteal
Posts: 1
Joined: Thu Nov 05, 2009 1:11 pm
Location: austria
Contact:

how to add images?

Post by malibusteal »

Hi,

I tried to add image but I don't know how to do this
Can anyone be kind to tell me how?

thanks a lot
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: how to add images?

Post by sorin_ristache »

Hello,

Please specify more details about the image and the place where you want to add it. For example you add an image to an XML document for including it in the output of the transformation of that XML document to the PDF format or the HTML format with a link element that depends on the schema of the XML document. For example in case of a DocBook XML document you add a link to the image to the document with the element imagedata that has an attribute fileref for the image file path:

Code: Select all

<figure>
<title>Lake in Fagaras</title>
<mediaobject>
<imageobject>
<imagedata fileref="../lake.jpeg" scale="100"/>
</imageobject>
</mediaobject>
</figure>

Regards,
Sorin
Pinky&Brain
Posts: 2
Joined: Fri Dec 04, 2009 2:23 pm

Re: how to add images?

Post by Pinky&Brain »

Hi.
I have problems show an SVG after transformation from an XML document to an HTML format. Into PDF it works correctly.
The title is displayed but not the grafik.

<figure>
<title>Testobjekt</title>
<mediaobject>
<imageobject>
<imagedata fileref='Dokument.svg' format="svg" width="15cm">
</imagedata>
</imageobject>
</mediaobject>
</figure>

Regards,
Pinky&Brain
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: how to add images?

Post by george »

I assume you are using DocBook.
Pinky&Brain wrote:[...]
<imagedata fileref='Dokument.svg' format="svg" width="15cm">
[...]
Your document is invalid, the correct value for format is SVG (with upper case letters) and not svg. I tested a simple file like below and it worked ok:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.docbook.org/xml/4.4/docbookx.dtd">
<article>
<title>Article Title</title>
<sect1>
<title>Section1 Title</title>
<para>Text<figure>
<title>Testobjekt</title>
<mediaobject>
<imageobject>
<imagedata fileref='shapes.svg' format="SVG" width="15cm"/>
</imageobject>
</mediaobject>
</figure></para>
</sect1>
</article>
Best Regards,
George
George Cristian Bina
Pinky&Brain
Posts: 2
Joined: Fri Dec 04, 2009 2:23 pm

Re: how to add images?

Post by Pinky&Brain »

Yes I do use DocBook Ver.5.
It worked fine, thank you.
Maybe you can help me further. The original problem is that I wanted to use XML Code to implement the single SVG Objects (quares / circles aso.) to the document instead of implement an whole picture.

But I got error codes during transformation

F.e.
[Saxon6.5.5] Element namedview in namespace 'http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' encountered in svg, but no template matches.
[Saxon6.5.5] Element grid in namespace 'http://www.inkscape.org/namespaces/inkscape' encountered in sodipodi:namedview, but no template matches.
[Saxon6.5.5] Element path-effect in namespace 'http://www.inkscape.org/namespaces/inkscape' encountered in defs, but no template matches.
....

and this is shown insted of the Objects

<sodipodi:namedview> <inkscape:grid></inkscape:grid> </sodipodi:namedview> <inkscape:path-effect></inkscape:path-effect> <inkscape:path-effect></inkscape:path-effect> <inkscape:path-effect>
....
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: how to add images?

Post by george »

Hi,

From the messages you posted it looks like you are using elements that the DocBook stylesheets do not know how to process, thus the messages you got.

Please take a look in the oXygen samples as we have there a DocBook 5 file that contains embedded SVG and links to SVG files. That should be a good working sample to start with. You can find it in [oxygen]/samples/docbook/v5/sampleMathMLandSVG.xml where [oxygen] is the folder where you installed oXygen. Try the "DocBook XHTML" transformation scenario.

Best Regards,
George
George Cristian Bina
Post Reply