Making Custom Modifications To PDF Templates
Making Custom Modifications To PDF Templates
MODIFICATIONS TO PDF
TEMPLATES
Table of Contents
PDF Templates .......................................................................................................................................... 3
How PDF templates are designed ............................................................................................... 4
Example HTML files with content ................................................................................................ 9
How PDF templates are processed ...........................................................................................10
Modifying a PDF template by hand...........................................................................................11
Example PDF Templates .............................................................................................................12
PDF Templates
PDF templates in Clarify are made up of HTML and CSS files. If you are have experience with
HTML and CSS then you can customize a template however you see fit.
Note that the PDF templates share the same format as ScreenSteps PDF templates. There
are some files in the templates that you won't use in Clarify. For example, the manual-
layout.html file is only applicable when you export a manual from ScreenSteps.
Any other files or folders in the ./Content folder are not processed by the Clarify exporter. They
are just resource files used by the HTML files. You can add any files you would like to use in
your template in this folder. This folder will be the root folder for any references you make in
your HTML.
1. The header div is taken out of the normal document flow and placed in the header of each
page.
2. The footer div is taken out of the normal document flow and placed in the footer of each
page.
3. The content div is where all document content is placed.
In addition, document properties are inserted into the template files using variables.
Content variables
• {{meta_title}}: The title of the manual or article that goes in the <head>.
• {{meta_subject}}: The title of the manual or article.
• {{meta_keywords}}: Always empty.
• {{meta_date}}: The current date.
• {{meta_generator}}: This is always "ScreenSteps".
• {{title}}: The title of the manual or article that can appear within the <body>.
• {{content}}: Replaced with the manual or article content.
• {{t_of_c}}: Replaced with the table of contents for the document.
• {{small_image}}: Maximum height for images that are classed as small.
• {{medium_image}}: Maximum height for images that are classed as medium.
• {{large_image}}: Maximum height for images that are classed as large.
• {{xlarge_image}}: Maximum height for images that are classed as xlarge.
This example shows the HTML that Clarify generates for documents You can use the
example to see the classes and ids assigned to different elements. Note that the images
used are not included.
clarify-pdf-article.zip
This example shows the normal output that Clarify generates when exporting a PDF.
Download clarify-pdf-article.zip
clarify-pdf-article-tofc.zip
This example shows the output that Clarify generates when the {{t_of_c}} variable is included in
a template.
Download clarify-pdf-article-tofc.zip
Prince
When a document is exported from Clarify the template being used is processed and all
content is inserted into the template. The root folder for any relative links in the HTML file will
be the ./Content folder in the template. This is where you can put any supporting images or
CSS files.
After the HTML, CSS, and image files have been generated they are passed off to an application
named Prince. Prince processes the HTML and creates the resulting PDF document. For full
documentation on Prince and what it supports please visit their site where you will find a User
Guide and Forums.
http://www.princexml.com
After the HTML files have been processed and the PDF file generated, the files are deleted from
the computer.
The template folder will be revealed in the Finder (Mac) or Windows Explorer (Windows). You
can then begin editing the files.
table-of-contents <div>
In order to add the table of contents a <div> with an id of table-of-contents was added to the
article-layout.html file. It displays the PDF template variable {{t_of_c}}.
Custom CSS
The following CSS is then added to the Custom CSS tab. The classes referenced in the CSS are
output by the {{t_of_c}} template variable.
#table-of-contents {
/* Name the page with this div so we can target header/footer and other props with
@page */
page: table-of-contents;
#table-of-contents .table-of-contents-title {
/* The text for the <h1> tag displaying the t of c title */
content: 'My Table of Contents';
}
#table-of-contents a {
text-decoration: none;
color: rgb(0,0,0);
}
#table-of-contents .step-tofc {
}
#table-of-contents .sub-step-tofc {
margin-left: 50px;
}
#table-of-contents a::after {
content: leader(".") target-counter(attr(href), page);
}