Gretyl's Portal

Heretto Help

Show Page Sections

Configure and Manage PDF Generator Publishing Scenarios

Create a Heretto PDF Generator Scenario

Heretto CCMS Administrator can create Heretto PDF Generator publishing scenarios.

  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 with very little customizations out of the box.
  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. Specify the maximum chapter-level TOCs depth by filling in the Chapter Toc Depth field.
      Enter 5
    Figure 1. Main TOC
    main table of content
    Figure 2. Chapter-Level TOC
    chapter level table of content
  7. If you want to add XSLT parameters:
    1. Click Add XSLT Param.
    2. Fill in the parameter fields.
      fig.caption.placement = below
      Tip: You can then use the XSLT parameters in the XSLT tab.
    3. If needed, make the parameter user-settable.
  8. Click Create.
  9. Click Save Scenario.

Enable or Disable a Heretto 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 3. Disabled publishing scenarios are not visible in the publishing interface
    • To enable a disabled publishing scenario, select Enable.
      Figure 4. Enabled publishing scenarios are visible in the publishing interface

Delete a Heretto 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 Heretto 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

Administrators 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.

Note:

Code syntax is not highlighted when you preview content in the publishing interface 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 parameter settings 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 the following import:
    @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