Gretyl's Portal

Heretto Help

Show Page Sections

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