Gretyl's Portal

Heretto Help

Show Page Sections

Cover Page

In Heretto PDF Generator, you can create front and back cover pages for your publishing scenario. Follow information provided in this section to build PDF Generator publishing scenarios based on Gray and Color templates. For more information about the templates, see Gray and Color Templates.

Table 1. Styling used in the default Gray and Color templates
Resource location:@import url("https://jorsek.github.io/pdfgen.github.io/styles1.1/modules/layout/cover_responsive.css");
@import url("https://jorsek.github.io/pdfgen.github.io/styles1.1/modules/layout/cover_generic.html");

You can examine the template code and apply required modifications to change the cover page layout.

Default behavior:

  • The Cover Page module creates only a front cover page.

  • The cover page layout is not affected by the DITA outputclass attributes.

  • The front cover page is added in the A4 portrait mode. To learn how to edit page size, see Page Orientation, Size, Margins.

Figure 1. Default Cover Page for the Gray Template
gray pdf cover page
Figure 2. Default Cover Page for the Color Template
color pdf cover page

Add a Custom Logo

Add your logo to the cover page of the Gray and Color templates. Follow information provided in this section to build PDF Generator publishing scenarios based on Gray and Color templates. For more information about the templates, see Gray and Color Templates.

You can host your logo on an external server, upload it to Heretto CCMS, or use the Base64 format. For more information, see Implementing Graphics.

  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. In the PDF Generator scenarios screen, click the publishing scenario you want to edit.
  3. In the Cover Page HTML tab, add this code with a link to a custom logo.
    <h1 class="cover-page-container">
        <div class="cover-page-content">
            <div class="title-text">{map.title}</div>
                <div class="bottom-stripe">
                    <div class="logo-container">
                        <div class="logo">
                          <img src="https://jorsek.github.io/pdfgen.github.io/styles1.1/media/logo_placeholder_generic_200px_500px.png"/>
    
                       </div>
                    </div>
                </div>  
            </div>
        </div>
    </h1>
  4. Replace https://jorsek.github.io/pdfgen.github.io/styles1.1/media/logo_placeholder_generic_200px_500px.png with a link to your logo.
  5. Click Save Scenario.
  6. Click the Select map to preview button to select the map you want to test with the updated scenario. Once selected, click the Generate PDF button.

Your logo image appears in the bottom-right corner of the cover page.

Figure 3. Cover Page with a Custom Logo
custom cover page logo

Center the Logo

Center your custom logo on the PDF cover page of the Gray and Color templates. Follow information provided in this section to build PDF Generator publishing scenarios based on Gray and Color templates. For more information about the templates, see Gray and Color Templates.

  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. In the PDF Generator scenarios screen, click the publishing scenario you want to edit.
  3. In the CSS tab, add this code:
    /* Center cover logo */
    .logo-container {
      left: 0; 
      right: 0; 
      margin-left: auto; 
      margin-right: auto;
    }
  4. Click Save Scenario.
  5. Click the Select map to preview button to select the map you want to test with the updated scenario. Once selected, click the Generate PDF button.

Your logo is centered on the cover page.

Figure 4. Centered logo
pdf cover centered logo

Style the Cover Page Title Text

You can change the font style of the title displayed on PDF cover pages. Follow information provided in this section to build PDF Generator publishing scenarios based on Gray and Color templates. For more information about the templates, see Gray and Color Templates.

  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. In the PDF Generator scenarios screen, click the publishing scenario you want to edit.
  3. In the CSS tab, add this code:
    /* Custom cover page title text. */
    .title-text {
        color: cyan;
        font-style: normal;
        font-weight: bold;
        size: 70px;
        line-height: 80px;
        letter-spacing: 0.08em;
        font-family: Verdana, Geneva, Tahoma, sans-serif;
    }
    Note:

    You can also use other font properties to modify the style and look of your document title. Learn more about CSS font styling from the W3Schools website.

  4. Modify the values so that they are aligned with your brand styling.

    Replace the cyan value of the color property with the name of another color or use a HEX value that you can obtain from Google Color Picker.

  5. Click Save Scenario.
  6. Click the Select map to preview button to select the map you want to test with the updated scenario. Once selected, click the Generate PDF button.

The title styling on your cover page is changed.

Figure 5. Cover Text Color
custom cover text

Change the Primary Background Color of the Cover Page

You can change the primary background color of your PDF cover page. Follow information provided in this section to build PDF Generator publishing scenarios based on Gray and Color templates. For more information about the templates, see Gray and Color Templates.

  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. In the PDF Generator scenarios screen, click the publishing scenario you want to edit.
  3. In the CSS tab, add this code:
    /* Custom cover page background. */
    .cover-page-container {
        background-color: darkorange;
    }
  4. Replace darkorange with the name of another color or use a HEX value that you can obtain from Google Color Picker.
  5. Click Save Scenario.
  6. Click the Select map to preview button to select the map you want to test with the updated scenario. Once selected, click the Generate PDF button.

Primary color of the cover page is replaced with a dark orange color.

Figure 6. Cover Background Color
custom cover background color

Change the Secondary Background Color of the Cover Page

You can change the secondary background color of your PDF cover page. Follow information provided in this section to build PDF Generator publishing scenarios based on Gray and Color templates. For more information about the templates, see Gray and Color Templates.

  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. In the PDF Generator scenarios screen, click the publishing scenario you want to edit.
  3. In the CSS tab, add this code:
    /* Custom cover page stripe background. */
    .bottom-stripe {
        background-color: skyblue;
    }
  4. Replace skyblue with the name of another color or use a HEX value that you can obtain from Google Color Picker.
  5. Click Save Scenario.
  6. Click the Select map to preview button to select the map you want to test with the updated scenario. Once selected, click the Generate PDF button.

The secondary color of the cover page is replaced with a sky blue color.

Figure 7. Cover Secondary Background Color
custom cover bottom stripe

Add a Border to the Cover Page

You can add a color border to the PDF cover page. Follow information provided in this section to build PDF Generator publishing scenarios based on Gray and Color templates. For more information about the templates, see Gray and Color Templates.

  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. In the PDF Generator scenarios screen, click the publishing scenario you want to edit.
  3. In the CSS tab, add this code:
    .cover-page-container,
    .bottom-stripe {
        border-left: 50px solid teal;
    }
  4. Modify the values of the border property so that they are aligned with your brand styling.
    Tip:

    Learn more about styling borders in CSS from the W3Schools website.

    Replace the teal value with a color of your choice. You can also use a HEX value obtained from Google Color Picker.

  5. Click Save Scenario.
  6. Click the Select map to preview button to select the map you want to test with the updated scenario. Once selected, click the Generate PDF button.

A teal stripe is added to the PDF cover page.

Figure 8. Cover Border
custom cover border on the left

Add Topicmeta Metadata to the Cover Page

You can display metadata of a map on the PDF cover page. This works for metadata added in the topicmeta element in both maps and bookmaps. Follow information provided in this section to build PDF Generator publishing scenarios based on Gray and Color templates. For more information about the templates, see Gray and Color Templates.

To add this advanced customization, you need to add specific structures to your DITA content and modify the HTML, CSS, and XSLT code of the publishing scenario.

Remember:

This procedure involves modifications to XSLT code. Such modifications are considered advanced configurations and require a solid understanding of XSLT and scripting. Without the appropriate expertise, there is a risk of accidentally introducing errors to XSLT code. If you or your team lack experience with XSLT, consult your Customer Success Manager to explore available options.

Add metadata to a map

  1. In the Content Library, double-click a map to open it in the Content Editor.
  2. Optional: In the map tree pane, click the Gear button and set your options like this:
    1. Set Icons to On.
    2. Set Show Elements to All.
    3. Set Element Names to Full.

    The map tree now shows color-coded elements with full element names. This view enables you to easily see and modify all elements in your sitemap.

  3. In the map tree, right-click the map title element, click Insert element after and insert the topicmeta element.
    Tip:

    If you prefer working in the Source Editor, right-click the map element and select Edit element XML. Add the required metadata directly to the source.

    The topicmeta element is added. It serves as a container for map metadata.

  4. Right-click the topicmeta element to open the context menu, select Append element and insert the first metadata.
  5. Right-click the first metadata you added and continue adding metadata.
    Important:

    Elements inside the topicmeta element need to be added in a specific order. Therefore, different elements might be available to insert depending on whether you append the topicmeta element or use the Insert element after or Insert element before options on the topicmeta child elements.

    To learn about the required order of topicmeta child elements, see DITA Specification website.

    In the example, there is metadata for the author, the publisher, and the category.

    <topicmeta>
    <author>John Doe</author>
    <publisher>Publishing Company</publisher>
    <category>User Guide</category>
    </topicmeta>
       
  6. Close the map.

Edit the PDF Generator scenario

  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. In the PDF Generator scenarios screen, click the publishing scenario you want to edit.
  3. Make these changes:
    1. Comment out the existing heading 1 (<h1>) code by putting it between <!-- and -->.
    2. Insert an empty <html/> element after the commented out h1 element.
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- <h1 class="cover-page-container">
      <div class="cover-page-content">
        <div class="title-text">{map.title}</div>
        <div class="bottom-stripe">
          <div class="logo-container">
            <div class="logo">
              <img src="https://jorsek.github.io/pdfgen.github.io/styles1.1/media/logo_placeholder_150px_350px.png"/>
            </div>
          </div>
        </div>
      </div>
    </h1> -->
    <html/>
    Important:

    This modification requires moving the cover page code to the XSLT tab. From now on, if you need to apply any changes to the cover page HTML code, it will be necessary include them in the commented section in the XSLT tab.

  4. In the XSLT tab, add this code under the <xsl:import> tag(s).
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
    
      <xsl:import href="/db/sdk2/internal/pdf_generator/pdf_generator.xsl"/>
    
    <!-- Add this code -->
        <!-- Enables you to develop cover pages in the XSLT tab -->
        <xsl:template match="*[contains(@class, ' map/map ')]" mode="chapterBody">
            <body>
                <xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-startprop ')]/@outputclass" mode="add-ditaval-style"/>
                <xsl:if test="@outputclass">
                    <xsl:attribute name="class" select="@outputclass"/>
                </xsl:if>
                <xsl:apply-templates select="." mode="addAttributesToBody"/>
                <xsl:call-template name="setidaname"/>
                <xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-startprop ')]" mode="out-of-line"/>
                <xsl:call-template name="generateBreadcrumbs"/>
                <xsl:call-template name="gen-user-header"/>
                <xsl:call-template name="processHDR"/>
                <xsl:if test="$INDEXSHOW = 'yes'">
                    <xsl:apply-templates select="/*/*[contains(@class, ' map/topicmeta ')]/*[contains(@class, ' topic/keywords ')]/*[contains(@class, ' topic/indexterm ')]"/>
                </xsl:if>
                <xsl:call-template name="gen-user-sidetoc"/>
                <xsl:call-template name="cover.page"/>
                <xsl:variable name="map" as="element()*">
                    <xsl:apply-templates select="." mode="normalize-map"/>
                </xsl:variable>
                <xsl:apply-templates select="$map" mode="toc"/>
                <xsl:call-template name="gen-user-footer"/>
                <xsl:call-template name="processFTR"/>
                <xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-endprop ')]" mode="out-of-line"/>
                <xsl:apply-templates select="/normalized/*[contains(@class, ' topic/topic ')]" mode="child.topic"/>
            </body>
        </xsl:template>
    
        <!-- Enables you to generate a map title -->
        <xsl:template name="get.map.title">
            <xsl:choose>
                <xsl:when test="//*[contains(@class, ' map/map ')]/*[contains(@class, ' topic/title ')]">
                    <xsl:apply-templates select="//*[contains(@class, ' map/map ')]/*[contains(@class, ' topic/title ')]"/>
                </xsl:when>
                <xsl:when test="//*[contains(@class, ' map/map ')]/@title">
                    <xsl:value-of select="//*[contains(@class, ' map/map ')]/@title"/> 
                </xsl:when>
                <xsl:when test="//*[contains(@class, ' map/map ')]//*[contains(@class, ' topic/title ')]//*[contains(@class, ' bookmap/mainbooktitle ')]">
                    <xsl:apply-templates select="//*[contains(@class, ' map/map ')]//*[contains(@class, ' topic/title ')]//*[contains(@class, ' bookmap/mainbooktitle ')]"/> 
                </xsl:when>
                <xsl:otherwise>
                    <xsl:comment>No title specified</xsl:comment>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:template>
    
        <!-- Enables you to override the HTML cover page -->
        <xsl:template name="cover.page">
            <h1 class="cover-page-container">
                <div class="cover-page-content">
                <div class="title-text"><xsl:call-template name="get.map.title"/>
                    <div class="topic-meta"> <!-- DEFINE TOPIC METADATA ELEMENTS OR ATTRIBUTES HERE -->
                        <div class="meta-value"><xsl:value-of select="//map/topicmeta//author"/></div>
                        <div class="meta-value"><xsl:value-of select="//map/topicmeta//publisher"/></div>
                        <div class="meta-value"><xsl:value-of select="//map/topicmeta//category"/></div></div>
                    </div>
                </div>
                    <div class="bottom-stripe">
                        <div class="logo-container">
                            <div class="logo">
                                <img src="https://jorsek.github.io/pdfgen.github.io/styles1.1/media/logo_placeholder_150px_350px.png"/>
                            </div>
                        </div>
                    </div>  
                </div>
            </h1>
        </xsl:template>
    <!-- End of add this code -->
    
    </xsl:stylesheet>
    • The topic-meta class is used as a container to globally style all the topic metadata displayed on the cover page.

    • The meta-value class is used to mark and style a single piece of metadata on the cover page.

  5. Edit the topic-meta section to define the metadata you want to show.
    <div class="topic-meta"> <!-- DEFINE TOPIC METADATA ELEMENTS OR ATTRIBUTES HERE -->
    <div class="meta-value"><xsl:value-of select="//map/topicmeta//author"/></div>
    <div class="meta-value"><xsl:value-of select="//map/topicmeta//publisher"/></div>
    <div class="meta-value"><xsl:value-of select="//map/topicmeta//category"/></div>
    </div>
  6. In the CSS tab, add this code at the end of the CSS code.
    /* Style the map title on the cover page */
    div.title-text > h1.topictitle1 {
    	color: #fff;
    	font-style: normal;
    	font-weight: bold;
    	text-align: left;
    	font-size: 80px;
    	word-wrap: normal;
    	letter-spacing: 0.025em;
    }
    
    /* Style topic metadata on the cover page */
    div.meta-value:first-of-type {
    	width: 65%;
    	border-top: 2px solid white;
    	margin-top: 15mm;
    	padding-top: 8px;
    }
    div.topic-meta {
    	font-size: 35%;
    	font-weight: normal;
    	line-height: 1.25em;
    }
  7. Click Save Scenario.
  8. Click the Select map to preview button to select the map you want to test with the updated scenario. Once selected, click the Generate PDF button.

DITA metadata is displayed on the cover page. Both the metadata and the map title are styled according to the applied CSS code.

Figure 9. Cover Page with Map Metadata
cover page with map metadata
Tip:

Visit the W3Schools website to learn how to reference paths in XSLT.

Add Bookmeta Metadata to the Cover Page

You can display bookmeta metadata on the PDF cover page. This works only for bookmaps. Follow information provided in this section to build PDF Generator publishing scenarios based on Gray and Color templates. For more information about the templates, see Gray and Color Templates.

Remember:

This procedure involves modifications to XSLT code. Such modifications are considered advanced configurations and require a solid understanding of XSLT and scripting. Without the appropriate expertise, there is a risk of accidentally introducing errors to XSLT code. If you or your team lack experience with XSLT, consult your Customer Success Manager to explore available options.

To add this advanced customization, you need to add specific structures to your DITA content and modify the HTML, CSS, and XSLT code of the publishing scenario.

Add bookmeta metadata

  1. In the Content Library, double-click a map to open it in the Content Editor.
  2. Optional: In the map tree pane, click the Gear button and set your options like this:
    1. Set Icons to On.
    2. Set Show Elements to All.
    3. Set Element Names to Full.

    The map tree now shows color-coded elements with full element names. This view enables you to easily see and modify all elements in your sitemap.

  3. In the map tree, right-click the bookmap element, click Insert element after and insert the bookmeta element.
    Tip:

    If you prefer working in the Source Editor, right-click the map element and select Edit element XML. Add the required metadata directly to the source.

    The bookmeta element is added. It serves as a container for the DITA metadata.

  4. Right-click the bookmeta element to open the context menu, select Append element and insert the first metadata.
  5. Right-click the first metadata you added and continue adding metadata.Do one of the following:
    Important:

    Elements inside the bookmeta element need to be added in a specific order. Therefore, different elements might be available to insert depending on whether you append the bookmeta element or use the Insert element after or Insert element before options on the bookmeta child elements.

    To learn about the required order of bookmeta child elements, see DITA Specification website.

    In the example, there is a publication date, category element and the version attribute value of the vrmlist element.

    Figure 10. Bookmap Structure Example
    bookmeta metadata example
    <bookmap>
    	<booktitle>
    		<mainbooktitle>Test Bookmap</mainbooktitle>
    	</booktitle>
    	<bookmeta>
    		<publisherinformation>
    			<published><completed><day>31</day><month>May</month><year>2022</year></completed>
    			</published>
    		</publisherinformation>
    		<category>User Guide</category>
    		<prodinfo>
    			<prodname/>
    			<vrmlist>
    				<vrm modification="" release="" version="1.0"/>
    			</vrmlist>
    		</prodinfo>
    	</bookmeta>
    	<chapter href="Test_Topic.dita"/>
    </bookmap>
  6. Close the map.

Edit the PDF Generator scenario

  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. In the PDF Generator scenarios screen, click the publishing scenario you want to edit.
  3. Make these changes:
    1. Comment out the existing heading 1 (<h1>) code by putting it between <!-- and -->.
    2. Insert an empty <html/> element after the commented out h1 element.
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- <h1 class="cover-page-container">
      <div class="cover-page-content">
        <div class="title-text">{map.title}</div>
        <div class="bottom-stripe">
          <div class="logo-container">
            <div class="logo">
              <img src="https://jorsek.github.io/pdfgen.github.io/styles1.1/media/logo_placeholder_150px_350px.png"/>
            </div>
          </div>
        </div>
      </div>
    </h1> -->
    <html/>
    Important:

    This modification requires moving the cover page code to the XSLT tab. From now on, if you need to apply any changes to the cover page HTML code, it will be necessary include them in the commented section in the XSLT tab.

  4. In the XSLT tab, add this code under the <xsl:import> tag(s).
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
    
      <xsl:import href="/db/sdk2/internal/pdf_generator/pdf_generator.xsl"/>
    
    <!-- Add this code -->
        <!-- Enables you to develop cover pages in the XSLT tab -->
        <xsl:template match="*[contains(@class, ' map/map ')]" mode="chapterBody">
            <body>
                <xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-startprop ')]/@outputclass" mode="add-ditaval-style"/>
                <xsl:if test="@outputclass">
                    <xsl:attribute name="class" select="@outputclass"/>
                </xsl:if>
                <xsl:apply-templates select="." mode="addAttributesToBody"/>
                <xsl:call-template name="setidaname"/>
                <xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-startprop ')]" mode="out-of-line"/>
                <xsl:call-template name="generateBreadcrumbs"/>
                <xsl:call-template name="gen-user-header"/>
                <xsl:call-template name="processHDR"/>
                <xsl:if test="$INDEXSHOW = 'yes'">
                    <xsl:apply-templates select="/*/*[contains(@class, ' map/topicmeta ')]/*[contains(@class, ' topic/keywords ')]/*[contains(@class, ' topic/indexterm ')]"/>
                </xsl:if>
                <xsl:call-template name="gen-user-sidetoc"/>
                <xsl:call-template name="cover.page"/>
                <xsl:variable name="map" as="element()*">
                    <xsl:apply-templates select="." mode="normalize-map"/>
                </xsl:variable>
                <xsl:apply-templates select="$map" mode="toc"/>
                <xsl:call-template name="gen-user-footer"/>
                <xsl:call-template name="processFTR"/>
                <xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-endprop ')]" mode="out-of-line"/>
                <xsl:apply-templates select="/normalized/*[contains(@class, ' topic/topic ')]" mode="child.topic"/>
            </body>
        </xsl:template>
    
        <!-- Enables you to generate a map title -->
        <xsl:template name="get.map.title">
            <xsl:choose>
                <xsl:when test="//*[contains(@class, ' map/map ')]/*[contains(@class, ' topic/title ')]">
                    <xsl:apply-templates select="//*[contains(@class, ' map/map ')]/*[contains(@class, ' topic/title ')]"/>
                </xsl:when>
                <xsl:when test="//*[contains(@class, ' map/map ')]/@title">
                    <xsl:value-of select="//*[contains(@class, ' map/map ')]/@title"/> 
                </xsl:when>
                <xsl:when test="//*[contains(@class, ' map/map ')]//*[contains(@class, ' topic/title ')]//*[contains(@class, ' bookmap/mainbooktitle ')]">
                    <xsl:apply-templates select="//*[contains(@class, ' map/map ')]//*[contains(@class, ' topic/title ')]//*[contains(@class, ' bookmap/mainbooktitle ')]"/> 
                </xsl:when>
                <xsl:otherwise>
                    <xsl:comment>No title specified</xsl:comment>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:template>
    
        <!-- Enables you to override the HTML cover page -->
        <xsl:template name="cover.page">
            <h1 class="cover-page-container">
                <div class="cover-page-content">
                <div class="title-text"><xsl:call-template name="get.map.title"/>
                    <div class="bookmeta-metadata"><!-- DEFINE BOOKMETA METADATA (ELEMENTS OR ATTRIBUTES) HERE -->
                        <div class="meta-value">
                            <xsl:value-of select="//bookmeta//category"/>
                        </div>
                        <div class="meta-value">
                            Publication date: <xsl:value-of select="//bookmeta//completed/day"/>&#160;<xsl:value-of select="//bookmeta//completed/month"/>&#160;<xsl:value-of select="//bookmeta//completed/year"/>
                        </div>
                        <div class="meta-value">
                            v<xsl:value-of select="//bookmeta//vrmlist/vrm/@version"/>
                        </div>
                    </div>
                </div>
                    <div class="bottom-stripe">
                        <div class="logo-container">
                            <div class="logo">
                                <img src="https://jorsek.github.io/pdfgen.github.io/styles1.1/media/logo_placeholder_150px_350px.png"/>
                            </div>
                        </div>
                    </div>  
                </div>
            </h1>
        </xsl:template>
    <!-- End of add this code -->
    
    </xsl:stylesheet>
    • The bookmeta-metadata class is used as a container to globally style all the bookmeta metadata displayed on the cover page.

    • The meta-value class is used to mark and style a single piece of metadata on the cover page.

    • To add text before metadata, introduce it right after the <div class="meta-value"> opening tag. For example:

      <div class="meta-value">Custom text added here<xsl:value-of select="//bookmeta//vrmlist/vrm/@version"/></div>
    • To concatenate values, introduce multiple <xsl:value-of> elements one after another within a single <div class="meta-value"> container. If you'd like to add a space between them, you need to separate them with &#160; which is a numeric entity reference for the non-breaking space character. For example:

      <div class="meta-value">Publication date: <xsl:value-of select="//bookmeta//completed/day"/>&#160;<xsl:value-of select="//bookmeta//completed/month"/>&#160;<xsl:value-of
      select="//bookmeta//completed/year"/></div>
  5. In the CSS tab, add this code at the end of the CSS code.
    /* Style the map title on the cover page */
      div.title-text > h1.topictitle1 {
        color: #fff;
        font-style: normal;
        font-weight: bold;
        text-align: left;
        font-size: 80px;
        word-wrap: normal;
        letter-spacing: 0.025em;
    }
    
    /* Style bookmeta metadata on the cover page */
    div.meta-value:first-of-type {
        width: 65%;
        border-top: 2px solid white;
        margin-top: 15mm;
        padding-top: 8px;
    }
    div.bookmeta-metadata {
        font-size: 35%;
        font-weight: normal;
        line-height: 1.25em;
    }
  6. Click Save Scenario.
  7. Click the Select map to preview button to select the map you want to test with the updated scenario. Once selected, click the Generate PDF button.

DITA bookmeta metadata is displayed on the cover page. Both the metadata and the map are styled according to the applied CSS code.

Figure 11. Cover Page with Bookmeta Metadata
cover page with bookmeta metadata

Add a Back Cover

Learn how to add an additional page as a back cover to your PDFs. Follow information provided in this section to build PDF Generator publishing scenarios based on Gray and Color templates. For more information about the templates, see Gray and Color Templates.

Remember:

This procedure involves modifications to XSLT code. Such modifications are considered advanced configurations and require a solid understanding of XSLT and scripting. Without the appropriate expertise, there is a risk of accidentally introducing errors to XSLT code. If you or your team lack experience with XSLT, consult your Customer Success Manager to explore available options.

To add this advanced customization, you need to add specific structures to your DITA content and modify the HTML, CSS, and XSLT code of the publishing scenario.

  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. In the PDF Generator scenarios screen, click the publishing scenario you want to edit.
  3. Make these changes:
    1. Comment out the existing heading 1 (<h1>) code by putting it between <!-- and -->.
    2. Insert an empty <html/> element after the commented out h1 element.
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- <h1 class="cover-page-container">
      <div class="cover-page-content">
        <div class="title-text">{map.title}</div>
        <div class="bottom-stripe">
          <div class="logo-container">
            <div class="logo">
              <img src="https://jorsek.github.io/pdfgen.github.io/styles1.1/media/logo_placeholder_150px_350px.png"/>
            </div>
          </div>
        </div>
      </div>
    </h1> -->
    <html/>
    Important:

    This modification requires moving the cover page code to the XSLT tab. From now on, if you need to apply any changes to the cover page HTML code, it will be necessary include them in the commented section in the XSLT tab.

  4. In the XSLT tab, add this code under the <xsl:import> tag(s).
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
    	<xsl:import href="/db/sdk2/internal/pdf_generator/pdf_generator.xsl"/>
    
    <!-- Add this code -->
    	<xsl:template match="*[contains(@class, ' map/map ')]" mode="chapterBody">
    		<body>
    			<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-startprop ')]/@outputclass" mode="add-ditaval-style"/>
    			<xsl:if test="@outputclass">
    				<xsl:attribute name="class" select="@outputclass"/>
    			</xsl:if>
    			<xsl:apply-templates select="." mode="addAttributesToBody"/>
    			<xsl:call-template name="setidaname"/>
    			<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-startprop ')]" mode="out-of-line"/>
    			<xsl:call-template name="generateBreadcrumbs"/>
    			<xsl:call-template name="gen-user-header"/>
    			<xsl:call-template name="processHDR"/>
    			<xsl:if test="$INDEXSHOW = 'yes'">
    				<xsl:apply-templates select="/*/*[contains(@class, ' map/topicmeta ')]/*[contains(@class, ' topic/keywords ')]/*[contains(@class, ' topic/indexterm ')]"/>
    			</xsl:if>
    			<xsl:call-template name="gen-user-sidetoc"/>
    			<xsl:call-template name="cover.page"/>
    			<xsl:variable name="map" as="element()*">
    				<xsl:apply-templates select="." mode="normalize-map"/>
    			</xsl:variable>
    			<xsl:apply-templates select="$map" mode="toc"/>
    			<xsl:call-template name="gen-user-footer"/>
    			<xsl:call-template name="processFTR"/>
    			<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-endprop ')]" mode="out-of-line"/>
    			<xsl:apply-templates select="/normalized/*[contains(@class, ' topic/topic ')]" mode="child.topic"/>
    			<xsl:call-template name="back.page"/>
    		</body>
    	</xsl:template>
    <!-- Generate cover page -->
    	<xsl:template name="cover.page">
    		<h1 class="cover-page-container">
    			<div class="cover-page-content">
    				<div class="title-text">
    					<xsl:call-template name="get.map.title"/>
    				</div>
    				<div class="bottom-stripe">
    					<div class="logo-container">
    						<div class="logo">
    							<img src="https://jorsek.github.io/pdfgen.github.io/styles1.1/media/logo_placeholder_150px_350px.png"/>
    						</div>
    					</div>
    				</div>
    			</div>
    		</h1>
    	</xsl:template>
    <!-- Add back page -->
    	<xsl:template name="back.page">
    		<!-- You can embed any HTML code you want -->
    		<h1 class="cover-page-container back-cover-page-container">
    			<div class="cover-page-content">
    				<div class="title-text"/>
    				<div class="bottom-stripe">
    					<div class="logo-container">
    						<div class="logo">
    							<img src="https://jorsek.github.io/pdfgen.github.io/styles1.1/media/logo_placeholder_150px_350px.png"/>
    						</div>
    					</div>
    				</div>
    			</div>
    		</h1>
    	</xsl:template>
    	<!-- Generate map title -->
    	<xsl:template name="get.map.title">
    		<xsl:choose>
    			<xsl:when test="//*[contains(@class, ' map/map ')]/*[contains(@class, ' topic/title ')]">
    				<xsl:apply-templates select="//*[contains(@class, ' map/map ')]/*[contains(@class, ' topic/title ')]"/>
    			</xsl:when>
    			<xsl:when test="//*[contains(@class, ' map/map ')]/@title">
    				<xsl:value-of select="//*[contains(@class, ' map/map ')]/@title"/>
    			</xsl:when>
    			<xsl:when test="//*[contains(@class, ' map/map ')]//*[contains(@class, ' topic/title ')]//*[contains(@class, ' bookmap/mainbooktitle ')]">
    				<xsl:apply-templates select="//*[contains(@class, ' map/map ')]//*[contains(@class, ' topic/title ')]//*[contains(@class, ' bookmap/mainbooktitle ')]"/>
    			</xsl:when>
    			<xsl:otherwise>
    				<xsl:comment>No title specified</xsl:comment>
    			</xsl:otherwise>
    		</xsl:choose>
    	</xsl:template>
    <!-- End of add this code -->
    
    </xsl:stylesheet>
  5. In the CSS tab, add the back cover styling in the CSS tab.
    /* Style the cover page title. */
      div.title-text > h1.topictitle1 {
        color: #fff;
        font-style: normal;
        font-weight: bold;
        text-align: left;
        font-size: 80px;
        word-wrap: normal;
        letter-spacing: 0.025em;
    }
    /* Style the back cover */
    .back-cover-page-container .logo-container {
      left: 0; 
      right: 0; 
      margin-left: auto; 
      margin-right: auto;
    }
  6. Click the Select map to preview button to select the map you want to test with the updated scenario. Once selected, click the Generate PDF button.
  7. Click Save Scenario.

An additional page is added at the end of a PDF document.

Figure 12. Sample Back Cover
sample back cover