Forum How do I...?

Metadata from SVG

nico
Hello,

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 :
<head>
	<meta name="author" content="My Name" />
	<meta name="date" content="2013-07-04" />
</head>

But how would you do it if the input is a SVG file ?
mikeday
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.
nico
For me the simplest would be to add a flag at the command line. Something like :
--meta-data=meta-data.txt

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

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.

mikeday
In the next release we will include command-line options and a JavaScript API for specifying the PDF metadata fields.
mikeday
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.