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

Re: graphics & multi-line text

Subject: Re: graphics & multi-line text
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Wed, 29 Jun 2005 22:37:27 +0200
fo external graphic alignment adjust
Michael Rerick wrote:
What I am trying to do is have a corporate graphic on the left side of a
page with the report text centered on the page and centered vertically on
the graphic (see below). This is at the top of the page. The report title
consists of two lines that need to have different font sizes. This is inside
a static-content region.


+-------+ | | | | Report Title (in 14pt font) | | Sub Title (in 12 pt font) | | +-------+

This is the closest I can get to what I want. The text is centered on the
page but is all on one line.

see below:
      <fo:root>
         <fo:layout-master-set>
            <fo:simple-page-master master-reference="page"
[snip]
               <fo:region-before extent="2.0in"/>
               <fo:region-body region-name="xsl-region-body"
                               margin-top="1.95in"

Note: this causes the region-before overlapping the body. It's best to use an margin-top for the body which is at least as large as the extent of the region before. In your case it probably wont matter because the content in the region-before isn't high enough.

[snip]
            <fo:static-content flow-name="xsl-region-before">
               <fo:table width="10.5in">
                  <fo:table-column column-number="1" column-width="1.5in"/>
                  <fo:table-column column-number="2" column-width="1in"/>
                  <fo:table-column column-number="3" column-width="3in"/>
                  <fo:table-column column-number="4" column-width="1in"/>
                  <fo:table-column column-number="5" column-width="1in"/>
                  <fo:table-column column-number="6" column-width="1in"/>
                  <fo:table-column column-number="7" column-width="1in"/>
                  <fo:table-column column-number="8" column-width="1in"/>

Why do you think you need 8 columns, especially given that there's no margin at the left? Two or three columns should be sufficient.

                  <fo:table-body>
                     <fo:table-row>
                        <fo:table-cell column-number="1"
number-columns-spanned="1">

Note: FOP usually requires you to enclose content in a table cells in blocks. If you actually seee the graphics, you've been lucky.

<fo:inline>

What's the reason for the fo:inline here?


                              <fo:external-graphic
src="url(Corporate_05_black.jpg)" scaling="unifiorm" height=".6in"
width=".6in"/>
                           </fo:inline>
                        </fo:table-cell>
                        <fo:table-cell column-number="2"
number-columns-spanned="7" line-height=".6in">
                           <fo:block font-family="serif" font-size="14pt"
font-weight="bold"
                              text-align="center"
alignment-adjust="text-after-edge">
                              <xsl:text>REPORT TITLE </xsl:text>
                              (SUB-TITLE
                           </fo:block>

If you want to have multiple lines, just use multiple blocks. Note that alignment-adjust isn't implemented in FOP. Furthermore, text-align="center" will center the content horizontally, not vertically. You could try display-align on the table cell (not the blocks) for vertical centering, but I'd recommend using space-before for this purpose. Try

   <fo:block font-family="serif" font-size="14pt" font-weight="bold"
     space-before="0.6in / 2 - 13.5pt">
         <xsl:text>REPORT TITLE </xsl:text>
   </fo:block>
   <fo:block font-family="serif" font-size="12pt" font-weight="bold">
         <xsl:text>(SUB-TITLE </xsl:text>
   </fo:block>

You might want to fine tune the space-before so that the text optically
centered.

J.Pietschmann

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.