Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

xml - Block Image Right and Flow Text Around It?

I'm working with DockBook 4.5 and Apache FOP 1.1 on Ubuntu 13.04. The Docbook translation are provided by Ubuntu and FOP was downloaded directly from Apache.

Would someone please tell me how to insert an image on the right of a paragraph, where the paragraph has text, too? Bonus points if scaling works (think: thumbnail). For example:

xxx xxx xxx xxx  +---------------+
xxxxxx xx xxx    |               |
xxxx xxxxx xxxxx |     Image     |
xxx xxxx xxx     |               |
xxx xxx xxxx xxx +---------------+
xxxxx xx xxx xxxx xxxxxx xx xx xxx
xx xxxxx xxx xxxxxxx  xxx xxxx xx
...

According to Wrap Text Around Image and Figure, I should be able to use floatstyle on a figure. But its not working for me.

I'm obviously doing something wrong, like pressing ENTER with the wrong finger. I won't bore readers with all the failed attempts using suggestions from the web over the past three or four hours. But they include figure, informalfigure, mediaobject, inlinemediaobject, imageobject, scale, floatstyle, and countless other tags in untold combinations.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

you need to use a formatter tnat supports fo:float.

http://xmlgraphics.apache.org/fop/compliance.html

For an example, it would be like this:

<fo:float float="right">
<fo:block text-align="center"
          border="1pt solid gray"
          font="bold italic 9pt Helvetica">
  <fo:block>
    <fo:external-graphic src="url('smile.gif')"/>
  </fo:block>
  <fo:block>
    Fig. 1: A Smiling Face
  </fo:block>
</fo:block>
</fo:float>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...