Page 1 of 1
PDF front page: Insert two items from a topic?
Posted: Thu Oct 09, 2025 8:13 pm
by tsurikov
Dear experts,
I use Oxygen XML Editor 27.1 to publish DITA content to PDF via a customized XSLT plug-in based on org.dita.pdf2. I need the PDF front page to pull two items from a topic, like this:
image.png
How could I do this, please? I'm fairly comfortable with other aspects of XSLT, plugins, and transformations ... I just can't figure out the XSLT code in this case. Specifically I can't figure out how to convince the DITA OT not to publish the front_page.dita topic as a regular topic using the typical page layout like all other topics use.
Thank you in advance for any help and suggestions!
Re: PDF front page: Insert two items from a topic?
Posted: Fri Oct 10, 2025 1:02 pm
by xephon
I'd suggest you create dedicated fields on the bookmap for this purpose. There is an old but good book, called DITA for Print. It will help you to get what you want.
Re: PDF front page: Insert two items from a topic?
Posted: Fri Oct 10, 2025 1:42 pm
by julien_lacour
Hello,
Besides what Stefan said, you should also take a look at the original "createFrontCoverContents" PDF2 template.
You could also follow the
"Embedding a Company Logo" from our user guide, this a good starting point for front page customization.
Regards,
Julien
Re: PDF front page: Insert two items from a topic?
Posted: Fri Oct 10, 2025 5:15 pm
by tsurikov
Thank you for your fast responses, xephon and Julien!
I have DITA For Print, love it, and use it constantly. I didn't find it helpful in this case because its front-cover customization examples are only for small individual elements in the bookmap (such as the title) or static elements that never change (such as the logo). I can't add regular topic content -- paragraphs, lists, tables, images -- directly in a bookmap. They must go in a topicref.
I think I've narrowed down my problem to XPath syntax. I just cannot figure out how to get the stylesheets to see my topic content. During testing, I couldn't even get them to see the entire front_page.dita topic. For example, I expected one of these to display the entire topic, but neither does -- the result is empty content:
<xsl:apply-templates select="$map/bookmap/frontmatter/topicref[1]"/>
<xsl:apply-templates select="$map/*[contains(@class, ' bookmap/frontmatter ')]/*[contains(@class, ' map/topicref ')][1]"/>
I know that Oxygen XML Editor includes an XSLT debugger with an XPath builder, but I haven't yet been able to get it set up for a DITA OT plug-in.
Re: PDF front page: Insert two items from a topic?
Posted: Mon Oct 13, 2025 9:47 am
by julien_lacour
Hello,
To set up the debugger for your plugin you can follow
this topic from our user-guide.
After integrating the plugin, it should appear in topic2fo_shell_fop.xsl imports.
You should be able to fetch the topic using something like:
Code: Select all
<xsl:variable name="front_page"
select="/descendant::*[contains(@class, ' topic/topic ')][@oid = 'front_page']"/>
As the stage1.xml file contains the ditamap with its topics merged.
Regards,
Julien