簡體   English   中英

Dita轉pdf部分兩欄輸出

[英]Dita to pdf partial two-column output

我想在dita / xml地圖上創建一個pdf基礎,其中的一個主題以報紙樣式的兩列輸出格式設置。

我已經在我的layout-masters-attr樣式表中找到了要使用的屬性: <xsl:attribute name="column-count">2</xsl:attribute>

這將為整個文檔創建一個兩列的輸出。 因此,我在區域主體屬性集中添加了@outputclass參數。 這沒有給我正確的結果。 有人知道如何為ditamap中的單個主題創建兩列輸出嗎?

我的樣式表定義:

<xsl:attribute-set name="region-body" use-attribute-sets="region-body.odd"/>            
<xsl:attribute-set name="region-body.odd">
<xsl:attribute name="margin-top">
<xsl:value-of select="$body-margin"/>
</xsl:attribute>
<xsl:attribute name="margin-bottom">
<xsl:value-of select="$body-margin"/>
</xsl:attribute>
<xsl:attribute name="{if ($writing-mode = 'lr') then 'margin-left' else 'margin-right'}">
<xsl:value-of select="$page-margin-inside"/>
</xsl:attribute>
<xsl:attribute name="{if ($writing-mode = 'lr') then 'margin-right' else 'margin-left'}">
<xsl:value-of select="$page-margin-outside"/>
</xsl:attribute>
<xsl:attribute name="column-count">
<xsl:choose>
<xsl:when test="@outputclass = 'twocol'">2</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:attribute-set>

我的主題定義:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic_hbq_pxv_yy">
<title>test</title>
<prolog/>
<body outputclass="twocol">

問題在於頁面序列必須具有正確的column-count屬性以及PDF2插件的工作方式,這是針對文檔,TOC,索引,正文等的特定區域設置的。 TU

要實現您想要的目標,您只需獲取主題的內容並將其放入2列表中。 雖然這不是最佳解決方案,但它是當前實施中可獲得的最佳解決方案。

如果您有機會使用Antenna House Formatter生成PDF,則可以通過指定fo:block-container / column-count =“ 2”輕松生成兩列布局。

列數/ CSS(-ah-)列數

http://www.antenna.co.jp/AHF/help/v64e/ahf-ext.html#columns

樣式表非常簡單,如下所示:

<xsl:template match="*[contains(@class,' topic/body ')][string(@outputclass) eq 'twocol']" priority="2">
    <fo:block-container column-count="2">
        <xsl:next-match/>
    </fo:block-container>
</xsl:template>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM