Publishing Template Package Contents for PDF CustomizationsEdit online
An Oxygen Publishing Template package must contain a template descriptor file and some other resources (such as CSS files). All the template resources can be stored in either a ZIP archive or in a folder. It is recommended to use a ZIP archive when you need it to share with others.
Template Descriptor FileEdit online
Each publishing template includes a descriptor file that defines the meta-data associated with template. It is an XML file that defines all the resources included in a template (such as CSS files and transformation parameters).
The template descriptor file must have the .opt file extension and must be located in the templates' root folder.
A PDF template descriptor might look like this:
<publishing-template>
<name>Flowers</name>
<pdf>
<tags>
<tag>purple</tag>
<tag>light</tag>
</tags>
<preview-image file="flowers-preview.png"/>
<resources>
<css file="flowers.css"/>
</resources>
<parameters>
<parameter name="figure.title.placement" value="top"/>
</parameters>
</pdf>
</publishing-template>
Template Name and Description
Each template descriptor file requires a name element. This information is displayed as the name of the template in the transformation scenario dialog box.
Optionally, you can include a description and it displayed when the user hovers over the template in the transformation scenario dialog box.
<publishing-template>
<name>Flowers</name>
<description>Flowers themed light colored template</description>
...
Template Author
Optionally, you can include author information in the descriptor file and it displayed when the user hovers over the template in the transformation scenario dialog box. This information might be useful if users run into an issue or have questions about a certain template.
If you include the author element, a name is required and optionally you can include email, organization, and organizationUrl information.
<publishing-template>
...
<author>
<name>John Doe</name>
<email>jdoe@example.com</email>
<organization>ACME</organization>
<organizationUrl>http://www.example.com/jdoe</organizationUrl>
</author>
...
PDF Element
The pdf element contains various details about the template and its resources that define the output. The elements that are allowed in this pdf section specify the template tags, template preview image, resources (such as CSS files), transformation parameters, or XSLT extensions.
<pdf>
<tags>
...
</tags>
<preview-image file="MyPreview.png"/>
<resources>
...
</resources>
<parameters>
...
</parameters>
</pdf>
Template Tags
The tags section provides meta information about the template (such as color theme). Each tag is displayed at the top of the Templates tab window in the transformation scenario dialog box and they help the user filter and find particular templates.
<publishing-template>
...
<pdf>
<tags>
<tag>purple</tag>
<tag>light</tag>
</tags>
Template Preview Image
The preview-image element is used to specify an image that will be displayed in
the transformation scenario dialog box. It provides a visual representation of the
template to help the user select the right template. The image dimensions should be
200 x 115 pixels and the supported image formats are:
JPEG, PNG, or GIF.
Online preview icon in the bottom-right
corner of the image in the transformation scenario dialog box and if the user clicks that
icon, it will open the specified URL in their default
browser.<publishing-template>
...
<pdf>
...
<preview-image file="ashes/ashes-tree.png"/>
<online-preview-url=https://www.example.com/samples/tiles/ashes</online-preview-url>Template ResourcesEdit online
<publishing-template>
...
<pdf>
...
<resources>
<css file="css/custom_styles.css"/>
<css file="css/custom_fonts.css"/>
</resources>XSLT Extension PointsEdit online
<publishing-template>
...
<pdf>
...
<xslt>
<extension
id="com.oxygenxml.pdf.css.xsl.merged2html5"
file="xslt/merged2html5Extension.xsl"/>
<extension
id="com.oxygenxml.pdf.css.xsl.merged2merged"
file="xslt/merged2mergedExtension.xsl"/>
</xslt>For more information about the available extension points, see: XSLT Extensions for PDF Transformations.
Transformation ParametersEdit online
<publishing-template>
...
<pdf>
...
<parameters>
<parameter name="show.changes.and.comments" value="yes"/>
</parameters>
</pdf>The following information can be specified in the parameter element:
- Parameter name
-
The name of the parameter. It may be one of the transformation parameters listed in the Parameters tab of the DITA Map to PDF - based on HTML5 & CSS transformation scenario or a DITA-OT PDF-based output parameter.
Note: It is not recommended to specify an input/output parameter in the descriptor file (such as the input Map, DITAVAL file, or temporary directory).Attention: JVM arguments like -Xmx cannot be specified as a transformation parameter. - Parameter Value
- The value of the parameter. It should be a relative path to the template root folder for file paths parameters.
- Parameter Type
- The type of the parameter:
stringorfilepath. Thestringvalue is default.
After creating a publishing template and adding it to the templates gallery, when you select the template in the transformation scenario dialog box, the Parameters tab will automatically be updated to include the parameters defined in the descriptor file. These parameters are displayed in italics.
Combining PDF and WebHelp Responsive Customizations in a Template PackageEdit online
webhelp and pdf element and
some of the resources can be
reused.<publishing-template>
<name>Flowers</name>
<description>Flowers themed light colored template</description>
<webhelp>
<tags>
<tag>purple</tag>
<tag>light</tag>
</tags>
<preview-image file="flowers-preview.png"/>
<resources>
<css file="flowers-wh.css"/>
<css file="flowers-page-styling.css"/>
</resources>
<parameters>
<parameter name="webhelp.show.main.page.tiles" value="no"/>
<parameter name="webhelp.show.main.page.toc" value="yes"/>
</parameters>
</webhelp>
<pdf>
<tags>
<tag>purple</tag>
<tag>light</tag>
</tags>
<preview-image file="flowers-preview.png"/>
<resources>
<css file="flowers-pdf.css"/>
<css file="flowers-page-styling.css"/>
</resources>
<parameters>
<parameter name="show.changes.and.comments" value="yes"/>"/>
</parameters>
<pdf>
</publishing-template>