Page 1 of 1
Pictures in running text
Posted: Mon Apr 25, 2005 6:27 pm
by PeterRobertson
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?
Posted: Mon May 02, 2005 2:50 pm
by smaug42
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?
Posted: Mon May 02, 2005 3:11 pm
by PeterRobertson
guiicon was the first thing I tried, but it too puts the icon on a separate line

Posted: Tue May 03, 2005 4:32 pm
by sorin_ristache
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
Posted: Tue May 03, 2005 5:09 pm
by PeterRobertson
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?
Posted: Tue May 03, 2005 5:47 pm
by sorin_ristache
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
Posted: Fri May 06, 2005 10:09 am
by sorin_ristache
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