Page 1 of 1
Including Prolog content in PDF output
Posted: Thu Jan 09, 2020 3:43 am
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.
Re: Including Prolog content in PDF output
Posted: Thu Jan 09, 2020 11:58 am
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
Re: Including Prolog content in PDF output
Posted: Fri Jan 10, 2020 2:52 am
by SrTechWriter01
Thank you Radu!
I will try your suggestion and let you know how it goes.
Re: Including Prolog content in PDF output
Posted: Tue Jan 21, 2020 2:42 pm
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.
Re: Including Prolog content in PDF output
Posted: Tue Jan 21, 2020 2:45 pm
by Radu
Hi,
Dan's link above covers just the CSS-based PDF publishing.
Regards,
Radu