Configure and Manage PDF Generator Publishing Scenarios

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.

Enable Code Syntax Highlighting in PDF Generator

You can enable code syntax highlighting in PDF Generator publishing scenarios. Heretto CCMS uses the highlight.js syntax highlighting library, version 11.4.0. Once syntax highlighting is enabled in a PDF Generator scenario, when you publish with that scenario, code in code block elements is automatically detected and highlighted.

To complete this procedure, you must be assigned the Administrator role in Heretto CCMS.

Note:

Code syntax is not highlighted when you preview content in the publishing or Administration interface. Code is highlighted when you actually publish content.

  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. Click a scenario and, under Scenario Configuration, click Edit Extra Params.
    Note:

    If you don't see the Edit Extra Params option, contact your Customer Success Manager.

  3. In the Parameters window, click New parameter and set the following fields:
    1. Set Type to Option.
    2. Set Name to pdfgen_highlight_code.
    3. In the Display name field, add a meaningful name. For example, Code Syntax Highlighting.
      If you leave Display name empty, the publishing interface shows the value that you set in the Name field.
    4. Leave the Max selected items option set to 1.
    5. Use New option to add two options in the Name field: true and false.

      When publishing, the system defaults to the first option in this list. In this case, it will default to true.

    6. Optional: In the Display name field, add a meaningful name.
      If you leave the Display name empty, the publishing interface shows values that you set in the Name field.

    Your settings should look like this:

    Option parameter set to enable code syntax highlighting
    Note:

    An alternate way of setting code syntax highlighting is to use the String type. Here, you can decide if you want code syntax highlighting to be settable in the publishing interface. To make it settable, keep User settable selected. To make the option fixed, clear User settable.

    String parameter set to enable code syntax highlighting.
  4. Click Save.

    The Parameters window closes.

  5. In the CSS tab, add this import:
    PYTHON
    @import url("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.4.0/styles/default.min.css");
  6. Click Save Scenario.
You can now see the Code Syntax Highlighting option in the publishing interface. The default option is true.
The code syntax highlighting option in the publishing interface

Include Metadata in an Existing PDF Generator Scenario

Set up a PDF Generator scenario to include CCMS metadata in normalized DITA. This metadata can be used by advanced publishing scenario developers for custom XSLT or transformation extensions.

Note:

The PDF Generator uses the Prince formatter (formerly Prince XML) as its publishing engine, which processes HTML and CSS, but not normalized DITA. Once metadata is included in normalized DITA, advanced publishing scenario developers can create XSLT rules to output the metadata as HTML elements, like <meta> tags or visible content.

To complete this procedure, you must be assigned the Administrator role in Heretto CCMS.

This procedure explains how to include metadata in an existing PDF Generator scenario. To learn how to do it in a new scenario, see Create a PDF Generator Scenario.

Set up a publishing scenario to include metadata

  1. In the top-left corner, click the Main Menu and go to PDF Generator.
  2. Click a scenario and, under Scenario Configuration, click Edit Extra Params.
    Note:

    If you don't see the Edit Extra Params option, contact your Customer Success Manager.

  3. In the Parameters window, click New parameter and set the following fields:
    1. Set Type to Option.
    2. Set Name to include-ccms-metadata.
    3. In the Display name field, add a meaningful name. For example, Include metadata.
      If you leave Display name empty, the publishing interface shows the value that you set in the Name field.
    4. Leave the Max selected items option set to 1.
    5. Use New option to add two options in the Name field: true and false.

      When publishing, the system defaults to the first option in this list. In this case, it will default to true.

    6. Optional: In the Display name field, add a meaningful name.

      If you leave the Display name empty, the publishing interface shows values that you set in the Name field. In this case, true and false.

    Your settings should look like this:

    An option type parameter set to include CCMS metadata added to topics and maps in normalized DITA
    Note:

    An alternate way of including metadata is to use the String parameter type. Here, you can decide if you want the parameter to be user-settable in the publishing interface. When User settable is disabled, the setting is always enabled in the publishing interface.

    String parameter used to include metadata in PDF Generator. Type = string, name = include-ccms-metadata, display name = Include metadata, Enter value = true
  4. Click Save.

    The Parameters window closes.

  5. Click Save Scenario.

Verify that metadata is included in normalized DITA

  1. 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.
  2. Open the Normalized DITA tab and verify that CCMS metadata is present.

    An example of CCMS metadata:

    CODE
    <ccms-metadata name="status">in_progress</ccms-metadata>
    <ccms-metadata name="content-type">Map</ccms-metadata>
You can now see the Include metadata option in the publishing interface. The default option is true and users can set it to false.
The include metadata option enabled in the publishing interface