Page 1 of 1

Partial two column pdf output

Posted: Tue Jun 27, 2017 12:37 pm
by Edwin
Hi,
I want a part of the document to appear in a two-column style. I've found the attribute <xsl:attribute name="column-count">2</xsl:attribute> for that. This turns the whole document in a two column pdf output. So I've created an @outputclass for that in the layout-masters-attr . This does not seam to work. Does anyone have an idea how to create a two column output for just one topic in the ditamap?

layout-masters-attr:

Code: Select all


<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>
<xsl:attribute-set name="region-body.even">
<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-outside"/>
</xsl:attribute>
<xsl:attribute name="{if ($writing-mode = 'lr') then 'margin-right' else 'margin-left'}">
<xsl:value-of select="$page-margin-inside"/>
</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>

Topic body:

Code: Select all


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

Re: Partial two column pdf output

Posted: Wed Jun 28, 2017 7:54 am
by Radu
Hi,

Linking here to the same question you posted on StackOverflow:

https://stackoverflow.com/questions/447 ... umn-output

Unfortunately we do not have any experience doing this ourselves so besides the advice you got there I cannot add more.
When publishing DITA content to PDF from Oxygen there is also a transformation scenario called DITA Map PDF - WYSIWYG which lets you use CSS pagination rules to style the DITA content instead of using directly XSL-FO. You can either use a commercial engine for creating the PDF using CSS (either Prince XML or Antenna House) or the Oxygen internal "Chemistry" engine which is still in a beta stage in Oxygen 19.0.
If you want to know more about how this two-column topic could be done using CSS for creating the PDF I could get one of my colleagues who worked on this to give you more details.

Regards,
Radu