PdfMetadata

data class PdfMetadata(val title: String? = null, val author: String? = null, val subject: String? = null, val keywords: String? = null, val creator: String? = null, val producer: String? = "PdfKmp", val encryption: PdfEncryption? = null, val attachments: List<PdfAttachment> = emptyList(), val pdfACompliance: Boolean = false, val language: String? = null)

Document metadata written into the PDF info dictionary. All fields are optional; renderers omit empty values.

Two security/packaging concerns ride alongside the info-dictionary fields so that the existing driver factory signature (create(metadata, …)) keeps carrying everything a backend needs without widening DocumentSpec:

  • encryption requests standard-security password protection.

  • attachments embeds files into the document (e.g. a ZUGFeRD invoice XML).

Both are backend-dependent — see their own KDoc for the per-platform support matrix. Backends that cannot honour a request skip it silently rather than failing the render.

Constructors

Link copied to clipboard
constructor(title: String? = null, author: String? = null, subject: String? = null, keywords: String? = null, creator: String? = null, producer: String? = "PdfKmp", encryption: PdfEncryption? = null, attachments: List<PdfAttachment> = emptyList(), pdfACompliance: Boolean = false, language: String? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Files embedded into the document. Empty (the default) embeds nothing. See PdfAttachment for the platform support matrix.

Link copied to clipboard
val author: String? = null
Link copied to clipboard
val creator: String? = null
Link copied to clipboard

Optional document encryption. null (the default) produces an unencrypted document. See PdfEncryption for the platform support matrix.

Link copied to clipboard
val keywords: String? = null
Link copied to clipboard
val language: String? = null

Document language as a BCP-47 tag (e.g. "en", "en-US"). Written to the catalog /Lang entry by the JVM/Desktop backend — required for tagged-PDF / PDF/A accessibility. null (the default) writes no language. Ignored on Android and iOS.

Link copied to clipboard
val pdfACompliance: Boolean = false

Best-effort PDF/A-2b conformance. false (the default) produces an ordinary PDF. When true the JVM/Desktop backend embeds an XMP metadata packet (pdfaid:part=2, conformance=B), an sRGB output intent, sets the document MarkInfo /Marked true, and aligns the document info with the XMP.

Link copied to clipboard
Link copied to clipboard
val subject: String? = null
Link copied to clipboard
val title: String? = null