Forum How do I...?

Metadata from SVG


I would like to know if it is possible to add metadata in the PDF when the input file is in SVG format.

If the input is an HTML file you simply need to add some meta tags like :
	<meta name="author" content="My Name" />
	<meta name="date" content="2013-07-04" />

But how would you do it if the input is a SVG file ?
At the moment, I don't think you can. We will need to add a JavaScript API to control PDF metadata, and perhaps also support the SVG metadata elements.
For me the simplest would be to add a flag at the command line. Something like :

And the file meta-data.txt would simply contain entries like :
author="My Name"

This would be simpler when the user use mixed input (SVG+HTML) with the --input-list flag. This would also give the ability to override the meta data present in the HTML.

In the next release we will include command-line options and a JavaScript API for specifying the PDF metadata fields.
We have now released Prince 9 rev 2, which includes new command-line options for specifying PDF metadata, such as --pdf-title, --pdf-author, and so on. These can also be set through JavaScript, via properties of the PDF object.