Including Prolog content in PDF output

Post here questions and problems related to editing and publishing DITA content.
SrTechWriter01
Posts: 2
Joined: Thu Jan 09, 2020 3:34 am

Including Prolog content in PDF output

Post by SrTechWriter01 »

Is there a way to customize the out-of-the box DITA2 PDF transform so that the <Prolog> element can be included in PDF output?
I have heard this is possible and even fairly simple, but have not been able to find details.
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: Including Prolog content in PDF output

Post by Radu »

Hi,

There is an XSLT stylesheet which matches the DITA prolog element:

OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT3.x/plugins/org.dita.pdf2/xsl/fo/topic.xsl

Code: Select all

    <xsl:template match="*[contains(@class,' topic/prolog ')]"/>
As you see it does nothing by default. You could try to replace it with something like:

Code: Select all

    <xsl:template match="*[contains(@class,' topic/prolog ')]">
        <fo:block xsl:use-attribute-sets="prolog">
            <xsl:apply-templates/>
        </fo:block>
    </xsl:template>
Ideally you should not modify directly the publishing stylesheet, you can create your own PDF customization plugin which overwrites a certain template from the base plugins:

https://www.oxygenxml.com/doc/versions/ ... _logo.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
SrTechWriter01
Posts: 2
Joined: Thu Jan 09, 2020 3:34 am

Re: Including Prolog content in PDF output

Post by SrTechWriter01 »

Thank you Radu!

I will try your suggestion and let you know how it goes.
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Re: Including Prolog content in PDF output

Post by Dan »

Please also read:

https://www.oxygenxml.com/doc/versions/ ... aid-title5

You can extract the desired meta information using oxy_xpath and use it in the cover page, or in synthetic pages.
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: Including Prolog content in PDF output

Post by Radu »

Hi,

Dan's link above covers just the CSS-based PDF publishing.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply