PdfXmpMetadata

data class PdfXmpMetadata(val title: String? = null, val authors: List<String> = emptyList(), val description: String? = null, val keywords: String? = null, val subjects: List<String> = emptyList(), val producer: String? = null, val creatorTool: String? = null, val createDate: String? = null, val modifyDate: String? = null, val metadataDate: String? = null, val pdfVersion: String? = null, val xml: String)

Parsed view of an XMP (Extensible Metadata Platform) packet stored in the catalog's /Metadata stream. The XMP spec is ISO 16684-1; in PDF it's referenced from ISO 32000-1 §14.3.2 (PDF 2.0 §14.3) as the preferred way to carry document metadata. PDF 2.0 deprecates the trailer /Info dict but in practice readers consult both.

We extract the most common Dublin Core / Adobe PDF / XMP-basic properties. Anything else can be pulled from the xml string by the caller using their preferred XML tool — we don't ship a full XML parser.

Date fields are exposed as raw ISO 8601 strings (XMP uses 8601 rather than PDF's D:YYYYMMDDHHmmSS... form).

Constructors

Link copied to clipboard
constructor(title: String? = null, authors: List<String> = emptyList(), description: String? = null, keywords: String? = null, subjects: List<String> = emptyList(), producer: String? = null, creatorTool: String? = null, createDate: String? = null, modifyDate: String? = null, metadataDate: String? = null, pdfVersion: String? = null, xml: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

dc:creator — ordered sequence of author names.

Link copied to clipboard
val createDate: String? = null

xmp:CreateDate — ISO 8601.

Link copied to clipboard
val creatorTool: String? = null

xmp:CreatorTool — the originating authoring tool.

Link copied to clipboard
val description: String? = null

dc:description — language alternative; the x-default (or first) value.

Link copied to clipboard
val keywords: String? = null

pdf:Keywords — flat string, semicolons or commas at the author's discretion.

Link copied to clipboard
val metadataDate: String? = null

xmp:MetadataDate — ISO 8601; when the XMP packet itself was last modified.

Link copied to clipboard
val modifyDate: String? = null

xmp:ModifyDate — ISO 8601.

Link copied to clipboard
val pdfVersion: String? = null

pdf:PDFVersion — e.g. "1.7" or "2.0".

Link copied to clipboard
val producer: String? = null

pdf:Producer — the producing tool.

Link copied to clipboard

dc:subject — unordered Bag of subject tags.

Link copied to clipboard
val title: String? = null

dc:title — language alternative; the x-default (or first) value.

Link copied to clipboard
val xml: String

Raw XML packet (UTF-8 decoded).