[]
Represents XMP metadata associated with a document.
public class Metadata : PdfDictWrapper, IPdfDict
Initializes a new instance of the Metadata class.
public Metadata()
Gets the list of document contributors. Maps to Dublin Core 'contributor' property.
public ObservableCollection<string> Contributors { get; }
Gets or sets the document copyright. Maps to Dublin Core 'rights' property.
public string Copyright { get; set; }
Gets or sets the document coverage. Maps to Dublin Core 'coverage' property.
public string Coverage { get; set; }
Gets or sets the creation date. Maps to XMP 'CreateDate' property. If null, the current date/time is used.
public DateTime? CreateDate { get; set; }
Gets the list of document creators. Maps to Dublin Core 'creator' property.
public ObservableCollection<string> Creators { get; }
Gets or sets the creator tool, in PDF/A compatible documents this value should be the same as Creator.
public string CreatorTool { get; set; }
Gets the list of document dates. Maps to Dublin Core 'date' property.
public ObservableCollection<string> Dates { get; }
Gets or sets the document description. Maps to Dublin Core 'description' property.
public string Description { get; set; }
Gets the GcPdfDocument owning this object.
public GcPdfDocument Doc { get; }
Gets or sets the document identifier. Maps to Dublin Core 'identifier' property.
public string Identifier { get; set; }
Gets the list of document keywords, or subjects. Maps to Dublin Core 'subject' property.
public ObservableCollection<string> Keywords { get; }
Gets the list of document languages. Maps to Dublin Core 'language' property.
public ObservableCollection<string> Languages { get; }
Gets or sets the metadata date. Maps to XMP 'MetadataDate' property. If null, the current date/time is used.
public DateTime? MetadataDate { get; set; }
Gets or sets the modification date. Maps to XMP 'ModifyDate' property. If null, the current date/time is used.
public DateTime? ModifyDate { get; set; }
Gets or sets the PDF/A conformance version.
public PdfAConformanceLevel PdfA { get; set; }
Gets or sets the PDF/UA conformance version. Null indicates that the document is not PDF/UA compliant.
public int? PdfUa { get; set; }
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; }
Gets the list of document publishers. Maps to Dublin Core 'publisher' property.
public ObservableCollection<string> Publishers { get; }
Gets or sets a value indicating whether the metadata is marked as read-only.
public bool ReadOnly { get; set; }
Gets the list of document relations. Maps to Dublin Core 'relation' property.
public ObservableCollection<string> Relations { get; }
Gets or sets the document source. Maps to Dublin Core 'source' property.
public string Source { get; set; }
Gets or sets the document's title. Maps to Dublin Core 'title' property.
public string Title { get; set; }
Gets the list of document types. Maps to Dublin Core 'type' property.
public ObservableCollection<string> Types { get; }
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; }
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)
ns
stringXML namespace.
name
stringProperty name.
value
stringProperty value.
Formats a DateTime value for writing to metadata.
public static string FormatUTC(DateTime dateTime, bool forceTimeZoneOffset)
dateTime
System.DateTimeA DateTime value to format.
forceTimeZoneOffset
boolIndicates whether to force add time zone offset for a value even if it is 00:00. It is required in case of PDF/A.
Formatted string.
Gets the content of the current metadata as a System.IO.Stream.
public Stream GetStream()
A System.IO.Stream representing the current metadata.
Gets the content of the current metadata as a System.Xml.XmlDocument.
public XmlDocument GetXmlDocument()
An System.Xml.XmlDocument representing the current metadata.
Resets values of this Metadata object to default values.
public void Reset()
Sets the content of the current metadata.
public void SetStream(Stream stream)
stream
System.IO.StreamThe System.IO.Stream object specifying the content.
Sets the content of the current metadata.
public void SetXmlDocument(XmlDocument doc)
doc
System.Xml.XmlDocument