Adjust Dita-OT plugin to output PDF wireframe with all blocks solid border

73 Views Asked by At

I'm interested to output solid black border surrounding all fo:blocks to aid in viewing where the borders are between elements displayed in a pdf output.

I would like to apply a transformation at the end of dita-ot plugin that applies the borders. I can fiddle with the following xsl however I'm not sure how to apply the xlst at the end of a dita-ot process.

    <?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet exclude-result-prefixes="xs ditaarch opentopic e" version="2.0" xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" xmlns:e="com.docdept.pdf" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:opentopic="http://www.idiominc.com/opentopic" xmlns:opentopic-func="http://www.idiominc.com/opentopic/exsl/function" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


        <xsl:template match="@*|*|processing-instruction()|comment()">
            <xsl:copy>
                <xsl:apply-templates select="*|@*|text()|processing-instruction()|comment()"/>
            </xsl:copy>
        </xsl:template>



    <xsl:template match="fo:block">
        <xsl:copy>
        <xsl:copy-of select="@*"/>

            <xsl:attribute name="border-style">solid</xsl:attribute>
            <xsl:attribute name="border-width">0.5pt</xsl:attribute>
            <xsl:attribute name="border-color">black</xsl:attribute>
            <xsl:apply-templates select="*"/>

        </xsl:copy>
    </xsl:template>

</xsl:stylesheet>

I thought perhaps the following to apply wireframe.xsl at the end of the process but this does not work.

<?xml version='1.0' encoding='UTF-8'?>
<plugin id="com.docdept.pdf">
  <require plugin="org.dita.pdf2" />
  <feature extension="dita.conductor.transtype.check" value="adjust-pdf" />
  <feature extension="dita.transtype.print" value="docdept-pdf" />
  <feature extension="dita.conductor.target.relative" file="integrator.xml" />
  <feature extension="dita.xsl.pdf" file="xsl/fo/wireframe.xsl"/>
</plugin>
1

There are 1 best solutions below

0
On BEST ANSWER

I'm seeing that it's better to associate borders of different colors to the attribute sets so there is visual reference that can also be searched for by color name within the fo output.

<xsl:attribute name="border">1mm thin solid</xsl:attribute>
<xsl:attribute name="border-color">GOLD</xsl:attribute>