Skip to main content

PDF Metadata

PDF documents can contain two kinds of metadata:

  • Standard PDF Document Properties like Title, Author, Keywords, etc.
  • XMP Metadata

Both metadata types are supported by printcss and renderpptx. Standard properties are normally added via HTML meta tags, whereas XMP metadata is added as an XML file based on a specific template, just as the HTML content is.

Standard PDF Document Properties​

Rendering engines create PDF metadata typically from the content of the HTML metadata elements for author, subject, keywords, etc. The exact mapping of metadata elements to PDF metadata differs between the engines. See the table below.

The data from the HTML metadata elements can typically be overridden by command line options.

The data can be extended by reading xmp data from a local file.

PDF CorePrinceXMLWeasyPrintPagedJS
/Title<title/><title/>TBD
/Author<meta name="author"/><meta name="author"/>TBD
/CreationDate<meta name="date"/><meta name="dcterms.created"/>TBD
/Subject<meta name="subject"/><meta name="description"/>TBD
/Creator<meta name="generator"/><meta name="generator"/>TBD
/Keywords<meta name="keywords"/><meta name="keywords"/>TBD
/ModDate(not supported)<meta name="dcterms.modified"/>TBD

A complete metadata section therefore might look like this:

<head>
<title>My PDF</title>
<meta name="author" content="Sue Doe" />
<meta name="subject" content="My PDF Subject" />
<meta name="description" content="My PDF Subject" />
<meta name="keywords" content="priint, cloud, paged media" />
<meta name="date" content="2025-12-06" />
<meta name="dcterms.created" content="2025-12-06T14:21:02Z" />
<meta name="dcterms.modified" content="2025-12-06T14:21:02Z" />
</head>

The Creator is hard coded into our application like priintcloud.com - rendercss/1.0. This cannot be set from the data as of now. The value for CreationDatecan currently be set by the data via date or dcterms.created. This needs to be discussed. The value for ModDatecan not be set but defaults to the current timestamp during PDF generation. If the value for date is set, then it MUST be in the form yyyy-MM-dd.

XMP Metadata​

XMP metadata can be included in the PDF metadata by specifying an XMP source file.

To add XMP metadata, users must do the following:

  1. Create an XMP template file using the selected templating engine (Handlebars or XSLT) and store it in the path together with the other templates.
  2. In config.ion set the property xmpTemplating to true.

The default position for XMP template files would be rendercss/handlebars/default.xmp.hbs for handlebars and rendercss/xslt/default.xmp.xslt for XSLT. If a different documentTemplate is used, please add XMP templates for each documentTemplate, e.g., rendercss/handlebars/myDocumenTemplate.xmp.hbs.

Example

Using Handlebars and Dublin Core metadata namespace (DC).

// rendercss/config.ion
{
templatingEngine: 'handlebars',
xmpTemplating: true,
}
<!-- rendercss/handlebars/default.xmp.hbs -->
<?xpacket begin="" id="{{env 'TICKET'}}"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/">
<xmp:CreatorTool>priintcloud</xmp:CreatorTool>
</rdf:Description>
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:language>{{lang}}</dc:language>
<dc:coverage>Temperatures between 10 and 42 °C</dc:coverage>
<!-- add more Dublin Core metadata here -->
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>