The pdf-template.vm file defines a default PDF template for downloading personal books and printing topics in the Reader page.
File location
user@host:/usr/local/afs7/conf$ tree
.
└── conf.xml
user@host:/usr/local/afs7/Fluid-Topics/conf$ tree
.
├── -
│ ├── mongo.conf.json
│ └── ws.conf.json
└── $TENANT_ID
├── conf.json
├── header.vm
├── pdf_templates
│ └── $TEMPLATE_DIRECTORY
│ └── pdf-template.vm
├── public
│ ├── custom.js
│ └── custom.less
└── vhost.conf.json
Example 1
The following lines show how to customize the PDF cover page by using the logo_atp.png image file and defining My Documentation Portal as the new title:
<!DOCTYPE html>
<html>
<head>
<title>PDF Export</title>
...
</head>
<body>
<section class="cover">
<img src="images/logo_atp.png" alt="Antidot Technical Publications"/>
<p class="tenant-title">My Documentation Portal</p>
<h1>$pbk-title</h1>
<p class="author">$author-display-name</p>
<p class="date">$formatted-date</p>
</section>
...
</body>
</html>
The cover page of the downloaded PDF of a personal book now appears as follows:
Example 2
The following lines show how to use the Velocity #if directive to configure metadata:
<table>
<tr>
<td><strong>Audience</strong></td>
<td>
#if($metadata["audience"])
$metadata["audience"]
#else
Not defined
#end
</td>
</tr>
<tr>
<td><strong>Version</strong></td>
<td><strong>$metadata["version"]</strong></td>
</tr></table>
If the audience metadata key has been configured for the content, the following information will appear:
If the audience metadata key has not been configured for the content, the following information will appear: