Configure the default filename of PDF exports - Fluid Topics - Latest

Fluid Topics Configuration and Administration Guide

Category
Reference Guides
Audience
public
Version
Latest

By default, PDF exports are named PDF Export.pdf.

To configure the filename, change the content of the <title> element of the pdf-template.vm file.

For example:

The following codeblock checks if a document has the Version metadata key with a value of Latest.

<title>
    #if($metadata["Version"] != "Latest")
        #set($title = "$pbk-title $metadata['Version'] $metadata['audience']")
        $title.toLowerCase().replace(" ", "_")
    #else
        $pbk-title.toLowerCase().replace(" ", "_")
    #end
</title>

If this condition is:

  • True

    The filename is the name of the document ($pbk-title) in lowercase, with all spaces replaced by underscores.

    For example, the Latest version of the Fluid Topics Configuration and Administration Guide becomes fluid_topics_configuration_and_administration_guide.pdf.

  • False

    The filename is the name of the document ($pbk-title), followed by the value of the Version metadata key, followed by the value of the audience metadata key.

    The combination of the three elements is in lowercase, with all spaces replaced by underscores.

    For example, the 4.1 version, with audience internal of the Fluid Topics Configuration and Administration Guide becomes fluid_topics_configuration_and_administration_guide_4.1_internal.pdf.