[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Displaying Icon in Page Margin

Subject: Displaying Icon in Page Margin
From: Brian Popp <bpopp@xxxxxxxxx>
Date: Wed, 14 Sep 2011 17:07:42 -0500
 Displaying Icon in Page Margin
I've been banging my head against a problem for most of the day and
Eliot Kimber suggested I bring it here. I have a specialized element
wrapper in DITA that can be applied to just about any phrase (list
item, table entry, para, etc.) I'm rendering to PDF via FO (XEP) and
what I'd like to do is draw a small icon approximately 20px from the
margin of the page wherever this element is used. If it's found inside
a table cell, for example, I'd like the icon to draw to the left of
the table inline with the cell where it's found.
I've tried two methods, neither of which is doing what I need. The
first looks like:

<fo:block-container absolute-position="fixed" left="20px">
  <fo:block >
    <fo:external-graphic src="url({concat($artworkPrefix,
$noteImagePath)})" />
  </fo:block>
</fo:block-container>

This works for locating the graphic along the left margin, but , but
unfortunately the graphic  is displayed at the top of the page and I
haven't been able to figure out a way to find the vertical position of
the element to be able to set a "top" attribute correctly.
The other method which seems more promising is to use floats like so:

<xsl:template match="limit">
...
        <xsl:if test="@origin='fdx'">
            <fo:float float="start" >
            <fo:block-container>
                <fo:block >
                <fo:external-graphic
                    src="url({concat($artworkPrefix, $noteImagePath)})"
                    xsl:use-attribute-sets="image"/>

            </fo:block>
            </fo:block-container>
            </fo:float>
        </xsl:if>

        <fo:inline>
            <xsl:if test="@memoryitem='yes'">
                <xsl:attribute
name="text-decoration">underline</xsl:attribute>
            </xsl:if>
            <xsl:apply-templates/>
        </fo:inline>
  </template>

This seems to work as designed, but unfortunately it is drawing the
graphic inside the table cell (to the left of the marked entry) and
not in the margin. Any help or pointers is greatly appreciated.

-bpopp

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.