Table of Contents

Class XmpWriter

Namespace
iTextSharp.text.xml.xmp
Assembly
iTextSharp.LGPLv2.Core.dll

With this class you can create an Xmp Stream that can be used for adding Metadata to a PDF Dictionary. Remark that this class doesn't cover the complete XMP specification.

public class XmpWriter
Inheritance
XmpWriter
Inherited Members

Constructors

XmpWriter(Stream)

Creates an XmpWriter. @throws IOException

public XmpWriter(Stream os)

Parameters

os Stream

XmpWriter(Stream, string, int)

Creates an XmpWriter. @throws IOException

public XmpWriter(Stream os, string utfEncoding, int extraSpace)

Parameters

os Stream
utfEncoding string
extraSpace int

XmpWriter(Stream, INullValueDictionary<string, string>)

@throws IOException

public XmpWriter(Stream os, INullValueDictionary<string, string> info)

Parameters

os Stream
info INullValueDictionary<string, string>

XmpWriter(Stream, PdfDictionary, int)

@throws IOException

public XmpWriter(Stream os, PdfDictionary info, int pdfXConformance)

Parameters

os Stream
info PdfDictionary
pdfXConformance int

Fields

EXTRASPACE

String used to fill the extra space.

public const string EXTRASPACE = "                                                                                                   \n"

Field Value

string

End

The end attribute.

protected char End

Field Value

char

ExtraSpace

You can add some extra space in the XMP packet; 1 unit in this variable represents 100 spaces and a newline.

protected int ExtraSpace

Field Value

int

UTF16

A possible charset for the XMP.

public const string UTF16 = "UTF-16"

Field Value

string

UTF16BE

A possible charset for the XMP.

public const string UTF16BE = "UTF-16BE"

Field Value

string

UTF16LE

A possible charset for the XMP.

public const string UTF16LE = "UTF-16LE"

Field Value

string

UTF8

A possible charset for the XMP.

public const string UTF8 = "UTF-8"

Field Value

string

Writer

The writer to which you can write bytes for the XMP stream.

protected StreamWriter Writer

Field Value

StreamWriter

XPACKET_PI_BEGIN

Processing Instruction required at the start of an XMP stream @since iText 2.1.6

public const string XPACKET_PI_BEGIN = "<?xpacket begin=\"\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?>\n"

Field Value

string

XPACKET_PI_END_R

Processing Instruction required at the end of an XMP stream for XMP streams that are read only @since iText 2.1.6

public const string XPACKET_PI_END_R = "<?xpacket end=\"r\"?>"

Field Value

string

XPACKET_PI_END_W

Processing Instruction required at the end of an XMP stream for XMP streams that can be updated @since iText 2.1.6

public const string XPACKET_PI_END_W = "<?xpacket end=\"w\"?>"

Field Value

string

about

The about string that goes into the rdf:Description tags.

protected string about

Field Value

string

Properties

About

public string About { set; }

Property Value

string

Methods

AddRdfDescription(string, string)

Adds an rdf:Description. @throws IOException

public void AddRdfDescription(string xmlns, string content)

Parameters

xmlns string
content string

AddRdfDescription(XmpSchema)

Adds an rdf:Description. @throws IOException

public void AddRdfDescription(XmpSchema s)

Parameters

s XmpSchema

Close()

Flushes and closes the XmpWriter. @throws IOException

public void Close()

SetReadOnly()

Sets the XMP to read-only

public void SetReadOnly()