public class XmpMetadata extends Object
Represents the XmpMetadata of a pdf document.
[C#] Pdf pdf = new Pdf(); Section s = pdf.Sections.Add(); Text text1 = new Text("This is a test for XMP Metadata"); s.Paragraphs.Add(text1); pdf.XmpMetadata = new XmpMetadata(); //core properties pdf.XmpMetadata.AddCreationDate(System.DateTime.Now.ToString()); //user properties pdf.XmpMetadata.AddUserProperty("xmlns:dc=\"http://purl.org/dc/elements/1.1/\"","dc:contributor","Aspose"); pdf.Save(@"d:\test\test.pdf"); [VB.Net] Dim pdf As Pdf = New Pdf Dim s As Section = pdf.Sections.Add() Dim text1 As Text = New Text("This is a test for XMP Metadata") s.Paragraphs.Add(text1) pdf.XmpMetadata = New XmpMetadata 'core properties pdf.XmpMetadata.AddCreationDate(System.DateTime.Now.ToString()) 'user properties pdf.XmpMetadata.AddUserProperty("xmlns:dc='http://purl.org/dc/elements/1.1/'", "dc:contributor", "Aspose") pdf.Save("d:\test\test.pdf") [XML] <Pdf xmlns="Aspose.Pdf"> <XmpMetadata> <MetadataItem Name="CreationDate" Value="2007-7-15 10:51:55" /> <MetadataItem XmlNamespace="xmlns:dc='http://purl.org/dc/elements/1.1/'" Name="dc:contributor" Value="Aspose" /> </XmpMetadata> <Section> <Text><Segment>This is a test for XMP Metadata</Segment></Text> </Section> </Pdf>
Modifier and Type | Field and Description |
---|---|
Hashmap |
MetadataEntries |
Constructor and Description |
---|
XmpMetadata()
Represents a constructor of the XmpMetadata object.
|
Modifier and Type | Method and Description |
---|---|
void |
addCreationDate(String date)
Adds the CreationDate property.
|
void |
addCreatorTool(String tool)
Adds the CreatorTool property.
|
void |
addMetaDataDate(String date)
Adds the MetaDataDate property.
|
void |
addModifyDate(String date)
Adds the ModifyDate property.
|
void |
addUserProperty(String xmlns,
String name,
String val)
Adds a user defined property.
|
byte[] |
getXmpMetadata() |
void |
processEntries() |
public Hashmap MetadataEntries
public XmpMetadata()
Represents a constructor of the XmpMetadata object.
public byte[] getXmpMetadata()
public void addCreationDate(String date)
Adds the CreationDate property. It will be added into "xmlns:xap='http://ns.adobe.com/xap/1.0/'" namespace.
date
- The value of the property.public void addCreatorTool(String tool)
Adds the CreatorTool property. It will be added into "xmlns:xap='http://ns.adobe.com/xap/1.0/'" namespace.
tool
- The value of the property.public void addModifyDate(String date)
Adds the ModifyDate property. It will be added into "xmlns:xap='http://ns.adobe.com/xap/1.0/'" namespace.
date
- The value of the property.public void addMetaDataDate(String date)
Adds the MetaDataDate property. It will be added into "xmlns:xap='http://ns.adobe.com/xap/1.0/'" namespace.
date
- The value of the property.public void addUserProperty(String xmlns, String name, String val)
Adds a user defined property.
xmlns
- The xml namespace.name
- The name of the property.val
- The value of the property.public void processEntries()
Copyright © 2016 Aspose. All Rights Reserved.