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 becomesfluid_topics_configuration_and_administration_guide.pdf
. -
False
The filename is the name of the document (
$pbk-title
), followed by the value of theVersion
metadata key, followed by the value of theaudience
metadata key.The combination of the three elements is in lowercase, with all spaces replaced by underscores.
For example, the
4.1
version, with audienceinternal
of the Fluid Topics Configuration and Administration Guide becomesfluid_topics_configuration_and_administration_guide_4.1_internal.pdf
.