[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.Metadata

Class Metadata

Namespace
GrapeCity.Documents.Pdf
Assembly
GcDocs.Pdf.dll

Represents XMP metadata associated with a document.

public class Metadata : PdfDictWrapper, IPdfDict
Inheritance
object
Metadata
Implements
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Extension Methods

Constructors

Metadata()

Initializes a new instance of the Metadata class.

public Metadata()

Properties

Contributors

Gets the list of document contributors. Maps to Dublin Core 'contributor' property.

public ObservableCollection<string> Contributors { get; }

Property Value

System.Collections.ObjectModel.ObservableCollection<T><string>

Gets or sets the document copyright. Maps to Dublin Core 'rights' property.

public string Copyright { get; set; }

Property Value

string

Coverage

Gets or sets the document coverage. Maps to Dublin Core 'coverage' property.

public string Coverage { get; set; }

Property Value

string

CreateDate

Gets or sets the creation date. Maps to XMP 'CreateDate' property. If null, the current date/time is used.

public DateTime? CreateDate { get; set; }

Property Value

System.DateTime?

Creators

Gets the list of document creators. Maps to Dublin Core 'creator' property.

public ObservableCollection<string> Creators { get; }

Property Value

System.Collections.ObjectModel.ObservableCollection<T><string>

CreatorTool

Gets or sets the creator tool, in PDF/A compatible documents this value should be the same as Creator.

public string CreatorTool { get; set; }

Property Value

string

Dates

Gets the list of document dates. Maps to Dublin Core 'date' property.

public ObservableCollection<string> Dates { get; }

Property Value

System.Collections.ObjectModel.ObservableCollection<T><string>

Description

Gets or sets the document description. Maps to Dublin Core 'description' property.

public string Description { get; set; }

Property Value

string

Doc

Gets the GcPdfDocument owning this object.

public GcPdfDocument Doc { get; }

Property Value

GcPdfDocument

Identifier

Gets or sets the document identifier. Maps to Dublin Core 'identifier' property.

public string Identifier { get; set; }

Property Value

string

Keywords

Gets the list of document keywords, or subjects. Maps to Dublin Core 'subject' property.

public ObservableCollection<string> Keywords { get; }

Property Value

System.Collections.ObjectModel.ObservableCollection<T><string>

Languages

Gets the list of document languages. Maps to Dublin Core 'language' property.

public ObservableCollection<string> Languages { get; }

Property Value

System.Collections.ObjectModel.ObservableCollection<T><string>

MetadataDate

Gets or sets the metadata date. Maps to XMP 'MetadataDate' property. If null, the current date/time is used.

public DateTime? MetadataDate { get; set; }

Property Value

System.DateTime?

ModifyDate

Gets or sets the modification date. Maps to XMP 'ModifyDate' property. If null, the current date/time is used.

public DateTime? ModifyDate { get; set; }

Property Value

System.DateTime?

PdfA

Gets or sets the PDF/A conformance version.

public PdfAConformanceLevel PdfA { get; set; }

Property Value

PdfAConformanceLevel

PdfUa

Gets or sets the PDF/UA conformance version. Null indicates that the document is not PDF/UA compliant.

public int? PdfUa { get; set; }

Property Value

int?

Producer

Gets or sets the document's producer. Maps to PDF 'Producer' property. The default is the versioned name of the GcPdf library.

public string Producer { get; set; }

Property Value

string

Publishers

Gets the list of document publishers. Maps to Dublin Core 'publisher' property.

public ObservableCollection<string> Publishers { get; }

Property Value

System.Collections.ObjectModel.ObservableCollection<T><string>

ReadOnly

Gets or sets a value indicating whether the metadata is marked as read-only.

public bool ReadOnly { get; set; }

Property Value

bool

Relations

Gets the list of document relations. Maps to Dublin Core 'relation' property.

public ObservableCollection<string> Relations { get; }

Property Value

System.Collections.ObjectModel.ObservableCollection<T><string>

Source

Gets or sets the document source. Maps to Dublin Core 'source' property.

public string Source { get; set; }

Property Value

string

Title

Gets or sets the document's title. Maps to Dublin Core 'title' property.

public string Title { get; set; }

Property Value

string

Types

Gets the list of document types. Maps to Dublin Core 'type' property.

public ObservableCollection<string> Types { get; }

Property Value

System.Collections.ObjectModel.ObservableCollection<T><string>

UserProps

Gets the list of document custom properties.

Note that the order of elements in the collection may change after saving and loading the document, this is due to the specifics of how properties are stored in the document, see the PDF specification for details.

public ObservableCollection<Metadata.UserProp> UserProps { get; }

Property Value

System.Collections.ObjectModel.ObservableCollection<T><Metadata.UserProp>

Methods

AddProperty(string, string, string)

Adds a property to metadata. Note that only allowed namespaces are:

"http://purl.org/dc/elements/1.1/" (Dublin Core Properties)

"http://ns.adobe.com/xap/1.0/" (XMP Core Properties)

"http://ns.adobe.com/pdf/1.3/" (PDF Properties)

Trying to add a property with another namespace will throw an exception.
public void AddProperty(string ns, string name, string value)

Parameters

ns string

XML namespace.

name string

Property name.

value string

Property value.

FormatUTC(DateTime, bool)

Formats a DateTime value for writing to metadata.

public static string FormatUTC(DateTime dateTime, bool forceTimeZoneOffset)

Parameters

dateTime System.DateTime

A DateTime value to format.

forceTimeZoneOffset bool

Indicates whether to force add time zone offset for a value even if it is 00:00. It is required in case of PDF/A.

Returns

string

Formatted string.

GetStream()

Gets the content of the current metadata as a System.IO.Stream.

public Stream GetStream()

Returns

System.IO.Stream

A System.IO.Stream representing the current metadata.

GetXmlDocument()

Gets the content of the current metadata as a System.Xml.XmlDocument.

public XmlDocument GetXmlDocument()

Returns

System.Xml.XmlDocument

An System.Xml.XmlDocument representing the current metadata.

Reset()

Resets values of this Metadata object to default values.

public void Reset()

SetStream(Stream)

Sets the content of the current metadata.

public void SetStream(Stream stream)

Parameters

stream System.IO.Stream

The System.IO.Stream object specifying the content.

SetXmlDocument(XmlDocument)

Sets the content of the current metadata.

public void SetXmlDocument(XmlDocument doc)

Parameters

doc System.Xml.XmlDocument