Develop a PDF Generator Template in Heretto CCMS

You you can develop a Heretto PDF Generator template directly in Heretto CCMS.

This procedure assumes that you want to base your template on either the Gray template or Color template.

Tip:

We recommend extending the Gray and Color templates with custom CSS rather than creating a template from scratch.

  1. Create a Heretto PDF Generator scenario. See Create a PDF Generator Scenario.
  2. In the right panel, enable the document preview:
    1. Click Select map to preview.
    2. In the Select Map window, select a map.
    3. Click Select.
      Tip:

      When you change the code, to refresh the preview, click Generate PDF.

  3. If you want to see the individual Gray template or Color template modules in the CSS tab:
    1. While holding the Ctrl keyboard key click the link.
    1. From the tab that opens, copy the entire code.
    2. Replace the contents of the CSS tab with the copied code.
    pdf default preview
  4. In the CSS, Cover page HTML, and XSLT tabs, customize the template.
    To learn about templates customization, see Heretto PDF Generator Templates Development.
    Important: Your edits are not automatically saved! As you develop the code, we recommend to periodically save the template by clicking Save Scenario.
    pdf gen save scenario
  5. Click Save Scenario.
  6. Close the Heretto PDF Generator by clicking the Close icon in the right-top corner.
Your publishing scenario is now available in the publishing interface.
  • To publish a map by using the template, see Heretto CCMS publishing guidelines.
  • To toggle the template in the publishing interface, see Enable or Disable a PDF Generator Scenario.
    Tip: To ensure that no one uses a template that is in development to publish a deliverable, you can hide it from the publishing interface.

Create a PDF Generator Scenario

Users assigned the Administrator role in Heretto CCMS can create and manage PDF Generator publishing scenarios in the CCMS. Any user with publishing permissions can use those publishing scenarios to generate output.

  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. Click New scenario.
  3. In the New scenario window, fill in the Scenario Name field with letters, numbers, hyphens, or underscore characters only.
    The name that you enter will be visible in the publishing interface.
  4. From the Template drop-down menu, select a template.
    Tip: The Gray and Color templates are complete and modular templates that you can use to publish your content out of the box with very little customizations.
  5. Click the Browse button and select where you want to save your configuration files.
    Tip:

    We recommend saving your templates in a single, obvious, and easily accessible directory in the Content Library.

  6. If you want to generate chapter-level tables of contents (TOCs):
    1. Select the Chapter Tocs check box.
    2. In the Chapter Toc Depth field, specify the number of maximum chapter-level TOC depth. For example, 5.
    Figure 1. Example of a Chapter-level TOC
    chapter level table of content
  7. If you want to include CCMS metadata in normalized DITA, select the Include metadata check box.
  8. If you want to add XSLT parameters:
    1. Click Edit XSLT Param.
    2. Fill in the parameter fields.
      Tip: You can then use the XSLT parameters in the XSLT tab.
      CODE
      XSLT:fig.caption.placement = below
    3. Optional: To make the parameter an option a user can select in the publishing interface, select User settable.

      Parameters that are not user-settable, are always enabled in the publishing scenario.

  9. Click Create.
  10. Click Save Scenario.

The scenario is now available in the publishing interface. Any user with publishing permissions can use it to publish content.

Enable or Disable a PDF Generator Scenario

Administrators can show or hide a publishing scenario in the publishing interface.

  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. Hover over a publishing scenario and click More actions .
  3. From the context menu, select an action:
    • To disable a publishing scenario, select Disable.
      Figure 2. Disabled publishing scenarios are not visible in the publishing interface
    • To enable a disabled publishing scenario, select Enable.
      Figure 3. Enabled publishing scenarios are visible in the publishing interface

Delete a PDF Generator Scenario

Administrators can delete publishing scenarios that are no longer needed.

  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. Hover over a publishing scenario and click More actions .
  3. From the context menu, select Delete.
  4. If prompted, confirm the deletion.

Duplicate a PDF Generator Scenario

Administrators can duplicate publishing scenarios.

Tip: Duplicating a publishing scenario is useful if you want to apply some styling modifications without the need to overwrite the original scenario.
  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. Hover over a publishing scenario and click More actions .
  3. From the context menu, select Duplicate.
  4. In the Duplicate scenario window:
    1. Optional: Edit the Scenario Name.
    2. Click the Browse button and select where you want to save your configuration files.
      Tip:

      We recommend saving your templates in a single, obvious, and easily accessible directory in the Content Library.

    3. Click Duplicate.
  5. Publish a document with the duplicated scenario.
    Note:

    If you save your scenario to a location that is different than the original scenario location, when publishing with the duplicated scenario, you may get this error: Error - Failed - unable to process: 500 Internal Server Error from POST https://workers.easydita.com/cms/v1/all-files/6ebe20b0-55ce-11eb-a796-02428d90e38c/download-as-bundle-for-pdfgen.

    If you do, you need to make a simple change in the scenario to fix that. Go back to PDF Generator scenario configuration and in the XSLT tab, change the xsl:import path from relative to absolute.

    • Relative: <xsl:import href="../../../../../../../../sdk2/internal/pdf_generator/pdf_generator.xsl"/>

    • Absolute: <xsl:import href="/db/sdk2/internal/pdf_generator/pdf_generator.xsl"/>

    When you then save the scenario, Heretto CCMS will reset the path to the correct relative path and therefore resolve the error.