Including Prolog content in PDF output

SrTechWriter01
Posts: 2
Joined: Thu Jan 09, 2020 3:34 am

Including Prolog content in PDF output

Post by SrTechWriter01 » Thu Jan 09, 2020 3:43 am

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: 6656
Joined: Fri Jul 09, 2004 5:18 pm

Re: Including Prolog content in PDF output

Post by Radu » Thu Jan 09, 2020 11:58 am

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 » Fri Jan 10, 2020 2:52 am

Thank you Radu!

I will try your suggestion and let you know how it goes.

Dan
Posts: 439
Joined: Mon Feb 03, 2003 10:56 am

Re: Including Prolog content in PDF output

Post by Dan » Tue Jan 21, 2020 2:42 pm

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: 6656
Joined: Fri Jul 09, 2004 5:18 pm

Re: Including Prolog content in PDF output

Post by Radu » Tue Jan 21, 2020 2:45 pm

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