2011-02-08 118 views
0

我使用XSL-fo生成modspecs(在docbook中)的pdf版本。即時通訊目前正在使用此XSLT來控制轉換:XSL FO:頁眉和頁腳內容溢出

... 
<xsl:param name="footer.rule" select="0"/> 
<xsl:param name="header.rule" select="1"/> 
<xsl:param name="fop.extensions" select="0"/> 
<xsl:param name="fop1.extensions" select="1"/> 

<xsl:template match="node()|@*"> 
    <xsl:copy> 
     <xsl:apply-templates select="node()|@*"/> 
    </xsl:copy> 
</xsl:template> 

<xsl:template name="footer.content"> 
    <xsl:param name="pageclass" select="''"/> 
    <xsl:param name="sequence" select="''"/> 
    <xsl:param name="position" select="''"/> 
    <xsl:param name="gentext-key" select="''"/> 
    <fo:block space-before="12pt" keep-together.within-page="auto"/> 
    <xsl:choose> 
     <xsl:when test="$position = 'left'"> 
      <fo:block>Acme Corp</fo:block> 
      <fo:block><fo:leader leader-pattern="space"/></fo:block> 
     </xsl:when> 
     <xsl:when test="$position = 'right'"> 
      <fo:block>Cool Stuff</fo:block> 
      <fo:block>Page <fo:page-number/> of <fo:page-number-citation ref-id="last-page"/></fo:block> 
     </xsl:when> 
    </xsl:choose> 
</xsl:template> 
<xsl:template name="header.content"> 
    <xsl:param name="pageclass" select="''"/> 
    <xsl:param name="sequence" select="''"/> 
    <xsl:param name="position" select="''"/> 
    <xsl:param name="gentext-key" select="''"/> 
    <xsl:choose> 
     <xsl:when test="$position = 'left'"> 
      <fo:block><fo:inline font-weight="bold"><xsl:value-of select="$app_name"/> - <xsl:value-of select="d:title/text()"/></fo:inline></fo:block> 
      <fo:block> 
       <fo:retrieve-marker retrieve-class-name="section.head.marker" 
        retrieve-position="first-including-carryover" 
        retrieve-boundary="page-sequence"/> 
      </fo:block> 
     </xsl:when> 
     <xsl:when test="$position = 'right'"> 
      <fo:block>Version <xsl:value-of select="$app_version"/></fo:block> 
      <fo:block> Build <xsl:value-of select="$build_number"/></fo:block> 
     </xsl:when> 
    </xsl:choose> 
</xsl:template> 

現在頁眉和頁腳都出現了罰款,但由於某種原因(特別是在modspec早期頁面),頁面的內容是重疊的頁眉和頁腳。有沒有辦法解決它,所以不再有任何重疊?

+0

王牌,這是關於1)XSLT(如何產生所需的FO輸出),或2)什麼FO輸出產生的問題,或3)爲什麼FO不產生預期的PDF?如果是1,請顯示所需的FO輸出與實際的FO輸出。如果2(我認爲是這樣),爲什麼要向我們展示您的XSLT?請顯示您當前的FO輸出(代表性樣本),包括頁面內容。如果是3,請說明您使用的FO處理器。 – LarsH 2011-02-08 20:05:30

回答