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


I do something like that but with text rather than an image. I put a
fo:leader rotated 90 degrees in the left margin and repeat its contents.
The contents of the leader depend on a parameter I pass in. You could
adapt it to use an image instead by replacing the fo:leader with what
you want and ajusting the position of the fo:block-container.

I ended up liking the text inside a leader on the left side of the page
approach over the draft.png watermark for several reasons. 1) The draft
image didn't appear when the pdf is printed (depends on printer and how
dark you made the image), and 2) Even if you make the draft.png pretty
light (so much so that it doesn't print on most printers) having it
behind the content of the page makes the page hard to read. The repeated
text in the leader in the left margin can be as dark as you want without
making the text on the page unreadable. I suppose someone could alter
the pdf to remove it, but it would require some effort. 
 
Xsl pasted below. I also use XEP. 

David

<!-- first I have a param that sets the text to whatever I want. I call
this motive.footer.text because it also appears (and was originaly used)
in the header and footer of html output -->
 <xsl:param name="motive.footer.text">
	<xsl:choose>
	  <xsl:when test="$security = 'external' and $nda.footer =
'true' and $include.alcatel.cobranding != 0">Motive and Alcatel-Lucent
Confidential</xsl:when>
	  <xsl:when test="$security = 'external' and $nda.footer =
'true'"><xsl:value-of select="$nda.footer.text"/></xsl:when>
	  <xsl:when test="$security = 'external'"/>
	  <xsl:when test="$security = 'writeronly'">Writer Only Copy -
Internal Only</xsl:when>
	  <xsl:when test="$security = 'reviewer'">Reviewer Copy -
Internal Only</xsl:when>
	  <xsl:when test="$protected = 'yes'">Internal Only
(Protected)</xsl:when>
	  <xsl:when test="$security = 'bjinternal'">Internal
Only</xsl:when>
	  <xsl:otherwise/>
	</xsl:choose>
  </xsl:param>

<!-- Then I have a template that puts motive.footer.text in a fo:leader.
The leader is in a fo:block-container with an absolute-position so it
will appear along the left edge of the page -->
  <xsl:template name="document.status.bar">
	<fo:block-container reference-orientation="90"
absolute-position="fixed" height="3in" width="11in" z-index="1"> 
	  <fo:block padding-before=".45in" font-size="1.5em"
color="gray" font-weight="bold">
		<fo:leader leader-pattern="use-content"
leader-length="15in" letter-spacing=".1em"><xsl:text>
</xsl:text><xsl:value-of select="$motive.footer.text"/><xsl:text>
</xsl:text></fo:leader>
	  </fo:block>
	</fo:block-container>
  </xsl:template> 

<!-- finally I override a template from pagesetup.xsl, adding calls to
the document status bar inside the fo:static-content for each flow-name.
I've indicated what I added with the text "my addition:" below -->
<xsl:template match="*" mode="running.head.mode">
  <xsl:param name="master-reference" select="'unknown'"/>
  <xsl:param name="gentext-key" select="local-name(.)"/>

  <!-- remove -draft from reference -->
  <xsl:variable name="pageclass">
    <xsl:choose>
      <xsl:when test="contains($master-reference, '-draft')">
        <xsl:value-of select="substring-before($master-reference,
'-draft')"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$master-reference"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>

  <fo:static-content flow-name="xsl-region-before-first">
			<!-- my addition: -->  <xsl:call-template
name="document.status.bar"/>

    <fo:block xsl:use-attribute-sets="header.content.properties">
      <xsl:call-template name="header.table">
        <xsl:with-param name="pageclass" select="$pageclass"/>
        <xsl:with-param name="sequence" select="'first'"/>
        <xsl:with-param name="gentext-key" select="$gentext-key"/>
      </xsl:call-template>
    </fo:block>
  </fo:static-content>

  <fo:static-content flow-name="xsl-region-before-odd">
			<!-- my addition: -->  <xsl:call-template
name="document.status.bar"/>

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

  <fo:static-content flow-name="xsl-region-before-even">
			<!-- my addition: -->  <xsl:call-template
name="document.status.bar"/>

    <fo:block xsl:use-attribute-sets="header.content.properties">
      <xsl:call-template name="header.table">
        <xsl:with-param name="pageclass" select="$pageclass"/>
        <xsl:with-param name="sequence" select="'even'"/>
        <xsl:with-param name="gentext-key" select="$gentext-key"/>
      </xsl:call-template>
    </fo:block>
  </fo:static-content>

  <fo:static-content flow-name="xsl-region-before-blank">
			<!-- my addition: -->  <xsl:call-template
name="document.status.bar"/>

    <fo:block xsl:use-attribute-sets="header.content.properties">
      <xsl:call-template name="header.table">
        <xsl:with-param name="pageclass" select="$pageclass"/>
        <xsl:with-param name="sequence" select="'blank'"/>
        <xsl:with-param name="gentext-key" select="$gentext-key"/>
      </xsl:call-template>
    </fo:block>
  </fo:static-content>

  <xsl:call-template name="footnote-separator"/>

  <xsl:if test="$fop.extensions = 0 and $fop1.extensions = 0">
    <xsl:call-template name="blank.page.content"/>
  </xsl:if>
</xsl:template>

> -----Original Message-----
> From: honyk [mailto:j.tosovsky@email.cz] 
> Sent: Friday, January 23, 2009 5:26 PM
> To: docbook-apps@lists.oasis-open.org
> 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]