Page 1 of 1

PDF Landscape orientation

Posted: Thu Feb 13, 2020 12:10 pm
by revaljilji
Hi,
I'm using orient="land" attribute by tables and it works great. This solution is suitable for printing, but in case user wants to view the page on the computer its difficult to read it. Is it possible to rotate the whole page containing the table with attribute orient set to land?

BR,
R

Re: PDF Landscape orientation

Posted: Thu Feb 13, 2020 12:16 pm
by Costin
Hi,

It is possible to rotate the whole topic that contains the table.
See the instructions under "If you want to rotate the entire topic that contains the big table, use:" in this page from DCPP User-Guide.

Regards,
Costin

Re: PDF Landscape orientation

Posted: Thu Feb 13, 2020 12:24 pm
by revaljilji
Thank you for the reply Costin. I didn't find any .css files in my plugin directory. We are using XSL:FO plugin.

Reading my post again I think my question wasn't specific and clear. I don't want whole content of the .dita page in the landscape mode, I'm fine with having the table on the separate page in the pdf. Instead I want the page with the rotated table to be in landscape format in pdf, so the page size should be 297x210 instead 210x297.

Re: PDF Landscape orientation

Posted: Sat Feb 15, 2020 12:30 pm
by Radu
Hi,

Sorry, we only have a solution for you using our CSS-based PDF output.
If you want this for XSL-FO based output maybe you can ask around on the DITA Users List.

Regards,
Radu

Re: PDF Landscape orientation

Posted: Mon Feb 24, 2020 2:29 pm
by revaljilji
Thank you for the reply. I'm trying to make my own Customization based on your landscape for chapters I found on github.
Depending on the outputclass I set the corresponding page-sequence. This works fine and I get the page in the landscape. However the body of the topic is not generated. Could you help me with this?

Code: Select all

<xsl:for-each select="opentopic:map/*[contains(@class, ' map/topicref ')]">
      <xsl:choose>
        <xsl:when test="@outputclass = 'landscape'">
          <fo:page-sequence master-reference="landscape-sequence" xsl:use-attribute-sets="page-sequence.body">
            <xsl:call-template name="startPageNumbering"/>
            <xsl:call-template name="insertBodyStaticContents"/>
            <fo:flow flow-name="xsl-region-body">
                <xsl:variable name="referencedTopic" select="key('topic-id', @id)" as="element()*"/>
                <xsl:for-each select="$referencedTopic">
                    <xsl:apply-templates select="[How to select body of the topic?]"/>
                </xsl:for-each>
            </fo:flow>
          </fo:page-sequence>
        </xsl:when>
        <xsl:otherwise>
            <fo:page-sequence master-reference="ditamap-body-sequence" xsl:use-attribute-sets="page-sequence.body">
            <xsl:call-template name="startPageNumbering"/>
            <xsl:call-template name="insertBodyStaticContents"/>
            <fo:flow flow-name="xsl-region-body">
                <xsl:variable name="referencedTopic" select="key('topic-id', @id)" as="element()*"/>
                <xsl:for-each select="$referencedTopic">
                    <xsl:apply-templates select="[How to select body of the topic?]"/>
                </xsl:for-each>
            </fo:flow>
          </fo:page-sequence>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:for-each>

Re: PDF Landscape orientation

Posted: Mon Feb 24, 2020 4:58 pm
by Radu
Hi,

You need to better understand on what XML content your XSLT stylesheet is applied. If you set the transformation "clean.temp" parameter to "no" and after publishing you look in the transformation temporary files folder you will find a "mapFileName_MERGED.xml" file. This is the XML file on which the XSLT is applied. As you can see inside the "_MERGED.xml" those "map/topicref" elements you are currently matching do not contain the topic contents. So your XSLT needs to match the actual topic contents and then look at the corresponding topicref to see if the orientation should be changed.
The XSLT from which you probably derived inspiration:

https://github.com/oxygenxml/dita-class ... custom.xsl

matches the chapter topic. That "processTopicChapter" template is overwrites is called from the "DITA-OT/plugins/org.dita.pdf2/xsl/fo/commons.xsl":

Code: Select all

    <xsl:template match="*[contains(@class, ' topic/topic ')]">
Regards,
Radu