Pictures in running text

Questions about XML that are not covered by the other forums should go here.
PeterRobertson
Posts: 47
Joined: Mon Apr 18, 2005 2:22 pm

Pictures in running text

Post by PeterRobertson » Mon Apr 25, 2005 6:27 pm

I have a number of small icons (.gif) that I need to display in
running text. For example, If X and Y are two such icons, I want
my PDF output to look like:

Code: Select all

Press the button X to start and Y to stop.
Everything I have tried results in:

Code: Select all

Press the button
X
to start and
Y
to stop.
Does anyone have any suggestions?

smaug42
Posts: 44
Joined: Tue May 25, 2004 2:27 pm

Post by smaug42 » Mon May 02, 2005 2:50 pm

My guess is that you are mapping all images to the "graphic" element in the DocBook side (stage before the PDF transform). There are a couple DocBook options you can (or at least should be able to) use. Take a look at the DocBook specifications for "guiicon" and "inlinegraphic". That may be exactly what you want.

But, that means you'll probably have to define a special tag on the XML side and tinker with your XSL to transform it to the right DocBook tags. Once that's handled, it should in theory transform to the PDF the way you want. (I haven't looked at the FO part yet... there may be some 'gotchas' there)

I haven't tried this yet... I have the same complaint about the XML I'm transforming to PDF and hope to find the time soon to try this out.

Maybe this will get you started on solving the problem though?

Anyone else want to chime in with comments or suggestions?

PeterRobertson
Posts: 47
Joined: Mon Apr 18, 2005 2:22 pm

Post by PeterRobertson » Mon May 02, 2005 3:11 pm

guiicon was the first thing I tried, but it too puts the icon on a separate line :-(

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache » Tue May 03, 2005 4:32 pm

Hello,

To display small icons in running text without breaking the line use guibutton with a nested inlinemediaobject like this:

Code: Select all


<guibutton>
<inlinemediaobject>
<imageobject>
<imagedata fileref="folder-name/icon-name.gif" format="GIF"/>
</imageobject>
</inlinemediaobject>
</guibutton>
Best regards,
Sorin

PeterRobertson
Posts: 47
Joined: Mon Apr 18, 2005 2:22 pm

Post by PeterRobertson » Tue May 03, 2005 5:09 pm

Here is my XML file:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
"C:\Program Files\Oxygen 5.\frameworks\docbook\dtd/docbookx.dtd" [
]>
<book>
<title>XXX</title>
<chapter><title>YYY</title>
<para>Here is a button,
<guibutton>
<inlinemediaobject>
<imageobject>
<imagedata fileref="Icon.gif" FORMAT="GIF"/>
</imageobject>
</inlinemediaobject>
</guibutton>, that appears in-line.
</para>
</chapter>
</book>
Ths PDF output it generates (using the standard Oxygen PDF options) looks like:

Code: Select all

Here            is            a          button,
X
, that appears in-line.
where X is my icon.

Any more ideas?

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache » Tue May 03, 2005 5:47 pm

Hello,

Your sample document works for me :( Please export the scenarios to a file (menu Options - Export transformation scenarios), send the result file, the DocBook document and the .gif icon at support at oxygenxml dot com and specify the name of the scenario that you used.

Best regards,
Sorin

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache » Fri May 06, 2005 10:09 am

Hello,

Just to note the conclusion - please make sure the width of the icon is not too large so that the FO processor must break the line because not all the text after the icon can be placed on the same line with the icon.

Best regards,
Sorin

Post Reply