OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] Stamp in outer margin

David described a method of using an absolutely positioned block-container, 
but it can be done with side regions too.  That's the method the FO 
designers intended, but it is harder to get working in the DocBook XSL 

The side areas are FO regions similar to the top and bottom regions used for 
headers/footers.  But the DocBook page-masters don't specify anything for 
the side regions, so there is no template to fill in with content as with 
header.content and footer.content.

But you can create your own custom page-masters that add the side regions 
(labelled "start" and "end" in FO parlance), and then you can do other 
customizations to fill them with content.  I can see how setting this up 
with empty placeholder templates would make an excellent feature request for 
future stylesheet releases.

In the mean time, you can create a set of simple-page-master elements that 
include region-start and region-end areas. For example:

    <fo:simple-page-master master-name="custom-body-odd"
      <fo:region-body margin-bottom="{$body.margin.bottom}"
      <fo:region-before region-name="xsl-region-before-odd"
      <fo:region-after region-name="xsl-region-after-odd"
      <fo:region-start region-name="xsl-region-start-odd"
      <fo:region-end region-name="xsl-region-end-odd"

This one is for odd body pages, so you would need to do this for as many 
different simple-page-masters are you need.

Note the addition of fo:region-start with zero extent for an odd page (the 
inside), and an fo:region-end with an extent value that is set with a 
parameter (the outside).  You create a set of such simple-page-masters, a 
custom fo:page-sequence-master that uses those simple-page-masters, and 
customize the template named "select.user.pagemaster" to call your custom 
page masters, all described here:


To fill the regions with content, you can customize the template named 
"running.head.mode" from fo/pagesetup.xsl, which sets up the 
fo:static-content for the region-before (top).  You want to add 
fo:static-content elements to also set up the region-start and region-end 
static content.  Add something like:

  <fo:static-content flow-name="xsl-region-end-odd">
    <fo:block xsl:use-attribute-sets="side.content.properties">
      <xsl:call-template name="side.margin.content">
        <xsl:with-param name="pageclass" select="$pageclass"/>
        <xsl:with-param name="sequence" select="'odd'"/>
        <xsl:with-param name="gentext-key" select="$gentext-key"/>

Note that the flow-name attribute here matches the region-name value in the 
simple-page-master.  That's how you can match up different content in 
different locations.

In this example I specified a new attribute-set named 
"side.content.properties", and a new template named "side.margin.content" 
that you would need to write to fill in the content of the side area.

If this sketch isn't sufficient, ask for more details.  When it is working, 
your FO file should contain your custom fo:simple-page-masters, your custom 
fo:page-sequence-masters, one or more fo:page-sequences whose 
master-reference attribute calls one of the custom page-sequence-masters, 
and the fo:page-sequences should also contain your custom fo:static-content 
elements for the side content.  There are a lot of details to take care of, 
but it does work when it is all in place.

Bob Stayton
Sagehill Enterprises

----- Original Message ----- 
From: "honyk" <j.tosovsky@email.cz>
To: <docbook-apps@lists.oasis-open.org>
Sent: Friday, January 23, 2009 3:25 PM
Subject: [docbook-apps] Stamp in outer margin

> Hello Everyone,
> I'd like to add stamp (picture) to the outer margin of PDF file, but I've
> found it is probably impossible as there are only specified
> header/body/footer areas on all default templates. It is intended as 
> static
> content. I've tried to modify header template (to add the block container
> with absolute position to ensure its position in proper place), but while
> left attribute is preserved, top attribute is ignored in XEP. I don't know
> exactly if such block out of defined static area is legal or it is not
> supported in XEP. If there are any more straightforward solutions, please
> let me know.
> Jan
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]