Table of Contents

Class PdfMetadata

Namespace
PdfSharp.Pdf
Assembly
PdfSharp.dll

Represents an XML Metadata stream.

public sealed class PdfMetadata : PdfDictionary
Inheritance
object
PdfMetadata
Inherited Members
Extension Methods

Constructors

PdfMetadata()

Initializes a new instance of the PdfMetadata class.

PdfMetadata(PdfDocument)

Initializes a new instance of the PdfMetadata class.

Properties

Xml

Obsolete, use ToString.

Methods

CreateDefaultMetadata()

Creates the XMP metadata for the PDF document. Creating XMP metadata is not the business of PDFsharp. This is a suggestion how you can do it.

SetMetadata(byte[])

Replaces the stream content with the specified byte array.

SetMetadata(string)

Sets the metadata stream.
The begin attribute of the “<?xpacket begin="{BOM}"” header, in double or single quotes, may be empty, hold the byte order mark U+FEFF, or name the encoding as ToString writes it, such as 'UTF8'.

ToString()

Converts the stream content to a string.
The BOM in “<?xpacket begin="{BOM}"” is set to “UTF-8” because a UTF-8 BOM cannot be a part of a Unicode string.