2016-07-07 4 views
0

ブロックを<fo:leader leader-length.minium="1in"/ >で埋めて残りを可変長(長さ)で埋めたいとします。XSL:FO fo:leader with fo:leader

問題は、テキストの内容がより多くのスペースを必要とし、実際の列に1つのドット行と1つのテキスト行の改行がある場合です。

私はAntenna HouseとXSLT 2.0を使用します。今

出力例:

 
1: | ................Text Text | 
2: |...........................| 
    |The Text is to long for the| 

正しい出力

 
|... This is some Text | 
| of the text.... | 

XSLTコード:

<fo:table-cell> 
    <fo:block text-align="justify" text-align-last="right"> 
     <xsl:if test="page"> 
     <fo:leader leader-pattern="dots" leader-length.minimum="1in" leader-length.optimum="4in" leader-length.maximum="4in"/> 
     </xsl:if> 
     <fo:inline ><xsl:apply-templates select="page" mode="normal"/></fo:inline></fo:block> 
    </fo:table-cell>  

私は、これは正しい出力を明確に願っています。

 
|.... 10,15,2010| Five dots minimum 
|______2105,1| (_ blank), output align right) 
+0

私はリーダーlength.optimumを使用する場合は、改行のために正しくなく動作します属性。 – Franz

+0

正しい出力にはテキストの前後にリーダーがありますか? –

答えて

2

AH Formatterのは最低限のリーダープラス1行のテキストに合うことができなかったので、改行は(AFAICT)に起こっていた、それが2行に分割されたとき、リーダーは4インチのあなたの最適な長さに拡大しました。

  1. fo:blockaxf:text-align-first="justify"を追加します。解決するために

    text-align-lasthttps://www.w3.org/TR/xsl11/#text-align-last)は、(最後の)ブロック領域の最後のライン領域の子に適用されます(ブロック領域の最初のライン領域でも同様です)。 axf:text-align-firsthttps://www.antennahouse.com/product/ahf63/ahf-ext.html#axf.text-align-first)はtext-align-lastよりも優先されるため、axf:text-align-first="justify"は1行ブロックを正当化します。

  2. デフォルトleader-length値を持つfo:leaderが現在利用可能なスペースを埋めるために拡大するなど、

    leader-length.minimumを削除します。

  3. (オプション)fo:blockaxf:leader-expansion="force"を追加します。

    axf:leader-expansionhttps://www.antennahouse.com/product/ahf63/ahf-ext.html#axf.leader-expansion)は、リーダーの拡張をさらに強要します。

例:

<fo:block-container width="2in" border="thin solid black"> 
    <fo:block text-align="justify" text-align-last="right" axf:text-align-first="justify"> 
     <fo:leader leader-pattern="dots"/>This is text</fo:block> 
    <fo:block text-align="justify" text-align-last="right" axf:text-align-first="justify"> 
     <fo:leader leader-pattern="dots"/>This is some of the text</fo:block> 
    <fo:block text-align="justify" text-align-last="right" axf:text-align-first="justify"> 
     <fo:leader leader-pattern="dots"/>This is some of the text plus a bit more</fo:block> 
    <fo:block text-align="justify" text-align-last="right" axf:text-align-first="justify"> 
     <fo:leader leader-pattern="dots"/>This is some of the text plus a whole lot more</fo:block> 
</fo:block-container> 

Screenshot of sample formatted.

+0

ありがとうございました。 – Franz