Class represents the XMP metadata for a PDF document.
For a list of all members of this type, see XmpMetadata members.
![]() ![]() ![]() ![]()
|
System.Object
ceTe.DynamicPDF.Resource
ceTe.DynamicPDF.Xmp.XmpMetadata
[Visual Basic]
Public Class XmpMetadata
Inherits Resource[C#]
public class XmpMetadata : ResourceFor more details on using XMP metadata take a look at the XMP Metadata topic.
This example shows how to create an Xmp Metadata and Add it to the document.
[Visual Basic]
Imports System
Imports System.IO
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.Xmp
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
MyDocument.Keywords = "XMP, metadata, pdf, example"
MyDocument.Title = "Pdf document with xmp metadata"
' Add blank pages to the document
MyDocument.Pages.Add(New Page(PageSize.Letter))
MyDocument.Pages.Add(New Page(PageSize.Letter))
' Create an Xmp Metadata
Dim MyXmp As XmpMetadata = New XmpMetadata
' Dublin Core Schema.
Dim Mydc As DublinCoreSchema = MyXmp.DublinCore
Mydc.Contributors.Add( "Abc" )
Mydc.Contributors.Add( "Xyz" )
Mydc.Contributors.Add( "Pqrs" )
Mydc.Coverage = "To test all the attributes of schema's provided"
Mydc.Creators.Add( "DynamicPDF" )
Mydc.Creators.Add( "ceTe Software" )
Mydc.Date.Add( DateTime.Now )
Mydc.Description.AddLang( "en-us", "XMP Schema's test" )
Mydc.Identifier = "First XMP pdf"
Mydc.Publisher.Add( "DynamicPDF.com" )
Mydc.Publisher.Add( "ceTe Software" )
Mydc.Relation.Add( "test pdf with xmp" )
Mydc.Rights.DefaultText = "ceTe Software Pvt. Ltd"
Mydc.Rights.AddLang( "en-us", "All rights reserved 2006, ceTe software." )
Mydc.Source = "XMP Project"
Mydc.Subject.Add( "eXtensible Metadata Platform" )
Mydc.Title.AddLang( "en-us", "XMP" )
Mydc.Title.AddLang( "it-it", "XMP - Piattaforma Estendible di Metadata" )
Mydc.Title.AddLang( "du-du", "De hallo Wereld" )
Mydc.Title.AddLang( "fr-fr", "XMP - Une Platforme Extensible pour les Métédonnées" )
Mydc.Title.AddLang( "DE-DE", "ÄËßÜ Hallo Welt" )
Mydc.Type.Add( "Pdf file containing xmp metadata" )
' Basic Schema.
Dim Mybs As BasicSchema = MyXmp.BasicSchema
Mybs.Advisory.Add( "Date" )
Mybs.Advisory.Add( "Contributors" )
Mybs.CreationDate = DateTime.Now
Mybs.Nickname = "xyz"
Mybs.Thumbnails.Add(106, 80, "JPEG", GetImage("C:\thumbnail.jpg"))
' Rights Management Schema.
Dim Myrm As RightsManagementSchema = New RightsManagementSchema
Myrm.Marked = true
Myrm.Owner.Add( "DynamicPDF" )
Myrm.UsageTerms.AddLang( "en-us", "Contact ceTe Software" )
MyXmp.AddSchema(Myrm)
' Basic Job Ticket Schema.
Dim MyJob As BasicJobTicketSchema = New BasicJobTicketSchema
MyJob.JobRef.Add( "ceTe", "Xmp Test", new Uri( "http://www.cete.com/" ) )
MyJob.JobRef.Add( "DynamicPDF", "XMP Metadata", new Uri( "http://www.dynamicpdf.com/" ) )
MyXmp.AddSchema(MyJob)
' Paged-Text Schema.
Dim Mypt As PagedTextSchema = New PagedTextSchema
MyXmp.AddSchema(Mypt)
' Need not have to add Dublic core schema, Basic Schema and
' Adobe Pdf schema at this point. These are already added internally.
MyXmp.AddSchema(Myrm)
MyXmp.AddSchema(MyJob)
MyXmp.AddSchema(Mypt)
' Add the Xmp Metadata to the document
MyDocument.XmpMetadata = MyXmp
' Save the PDF document
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
Private Function GetImage(ByVal filePath As String) As Byte()
Dim MyInFile As FileStream = New FileStream(filePath, FileMode.Open, FileAccess.Read)
Dim MyBinaryData(MyInFile.Length) As Byte
MyInFile.Read(MyBinaryData, 0, MyInFile.Length)
MyInFile.Close()
return MyBinaryData
End Function
End Module
[C#]
using System; |
This class is a DynamicPDF Generator Enterprise Edition feature. One of the following licenses is required for non-evaluation usage:
Namespace: ceTe.DynamicPDF.Xmp
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Assembly: ceTe.DynamicPDF (in ceTe.DynamicPDF.dll)
XmpMetadata Members | ceTe.DynamicPDF.Xmp Namespace
© Copyright 2007, ceTe Software