Forum How do I...?

How to set PDF metadata fields from element content?

hsivonen
I have noticed that Prince puts the contents of the XHTML title element into the PDF title metadata field, which is excellent.

However, I can't find a CSS rule with a special CSS property for setting metadata fields in the UA style sheet. Is there a way to assign the contents of an element to a PDF metadata field?

Something like:
.cover .author {
prince-pdf-meta: author content();
}
mikeday
Currently, Prince maps the XHTML <title> element and also the author, subject and keywords <meta> elements to PDF metadata. Non-XHTML documents can't specify PDF metadata at the moment. We don't yet have CSS properties to specify the PDF metadata, but your suggestion looks very sensible.
hsivonen
Great. Thanks. For some reason, it didn’t occur to me to try the meta element. :-)