Metadata properties

Metadata properties can be created during composition to control subsequent processing such as PDF creation or secondary transforms. A metadata property has a name and a value, which is a character string. The property name may contain letters, digits, hyphens, underscores, colons, or full stops.

At the conclusion of the composition run the property values are saved to a file in the partition. This file can be retrieved using the GETSTAT API call.

A metadata property can be created by the following command:

<meta name="Mname" string="STR" />

If more than one <meta> command is processed for a property name, the value used will be taken from the last one.

You can also associate the content of a user variable with a metadata property. Once a metadata property is associated with a variable, the association remains active for the duration of the composition run. Properties created this way use the string value of the user variable at the end of the composition.

Metadata properties are associated with a variable using the command:

<set var="Vname" meta="Mname" string="STR" />

where Mname is the metadata property name. The value to assign is determined as documented above. Take care when using the value option, as the resulting string value may represent an internal measurement.

A metadata property can be associated with at most one user variable. A warning will be generated if an association is removed because of a reassignment.

It is possible to associate the same variable with more than one metadata property. For example:

<set var="X1" meta="prop1" string=""/>
<set var="X1" meta="prop2" string=""/>
<set var="X1" string="XYZ"/>

will set both the prop1 and prop2 properties to “XYZ”.

[Note] Note

Other than for scanned <content/>, it is not possible to assign the content of a directive or runtime variable to a metadata property.

PDF metadata properties

Metadata properties can be used to control PDF creation. See the User Guide for a full list of property names.

The following example shows how to assign a title string to the pdf.title PDF metadata property:

<meta name="pdf.title" string="Using TopLeaf" />

Secondary transform metadata properties

Metadata properties can be used to set default values for secondary transform properties. The default is only used if no explicit value is set for the property when the transformation is performed.

The metadata name is “” where type is the type of output being created and property is the property name.

For example, the following sets the default for creating a new file in HTML output:

<meta name="convert.html.newfile" string="2" />

For a complete list of transform properties, see the description of secondary output options in the User Guide.