Closed steinbacher01 closed 3 years ago
Base PDF5-ML plug-in adopts bookmap/@xml:lang
for generating chapter prefix/suffix. This is because one publication should adopt consistent chapter prefix/suffix as a book.
Are there any other options available to create a single multilingual PDF? Can multiple PDFs be embeded together? Is it possible to publish embeded PDFs referenced within a DITA bookmap?
We have some multilingual documents that include up to 30 languages. What is the most efficient way to bundle these within a single PDF?
Thanks,
Leroy Steinbacher
if you want to generate "a multilingual PDF that has the correct translation of "Chapter" for each language", you can do it by changing following code into topic/title processing template and change it from getVarvalue
to getVarValueWithLang
to get the topic/@xml:lang
specific value.
https://github.com/AntennaHouse/pdf5-ml/blob/master/com.antennahouse.pdf5.ml/xsl/dita2fo_global.xsl
<xsl:variable name="cPartTitlePrefix" select="ahf:getVarValue('Part_Title_Prefix')" as="xs:string"/>
<xsl:variable name="cPartTitleSuffix" select="ahf:getVarValue('Part_Title_Suffix')" as="xs:string"/>
<xsl:variable name="cChapterTitlePrefix" select="ahf:getVarValue('Chapter_Title_Prefix')" as="xs:string"/>
<xsl:variable name="cChapterTitleSuffix" select="ahf:getVarValue('Chapter_Title_Suffix')" as="xs:string"/>
Thank you for the suggestion. I'm getting the following error.
Fatal Error! Cannot find a 1-argument function named Q{http://www.w3.org/2005/xpath-functions}getVarValueWithLang()
I added the code change you suggested above to the topic/title processing template.
com.antennahouse.pdf5.ml\xsl\dita2fo_title.xsl
<xsl:template match="*[contains(@class, ' topic/title ')]">
<xsl:variable name="cPartTitlePrefix" select="getVarValueWithLang('Part_Title_Prefix')" as="xs:string"/>
<xsl:variable name="cPartTitleSuffix" select="getVarValueWithLang('Part_Title_Suffix')" as="xs:string"/>
<xsl:variable name="cChapterTitlePrefix" select="getVarValueWithLang('Chapter_Title_Prefix')" as="xs:string"/>
<xsl:variable name="cChapterTitleSuffix" select="getVarValueWithLang('Chapter_Title_Suffix')" as="xs:string"/>
<xsl:apply-templates/>
</xsl:template>
Any suggestions?
Thanks,
Leroy
Try using template version of getVarValueWithLang instead.
<xsl:template name="getVarValueWithLang" as="xs:string">
<xsl:param name="prmVarName" as="xs:string" required="yes"/>
<xsl:param name="prmElem" as="element()" required="no" select="."/>
<xsl:param name="prmDocType" as="xs:string?" required="no" select="$defaultDocType"/>
<xsl:param name="prmPaperSize" as="xs:string?" required="no" select="$defaultPaperSize"/>
<xsl:param name="prmOutputType" as="xs:string?" required="no" select="$defaultOutputType"/>
<xsl:param name="prmBrandType" as="xs:string?" required="no" select="$defaultBrandType"/>
Thank you for the suggestions.
Question: Is it possible to generate a multilingual PDF that has the correct translation of "Chapter" for each language? We've customized this in the past, but we are wondering if there is a way to do it within the base pdf5-ml plugin.
Thanks,
Leroy Steinbacher