com.lowagie.text.xml.xmp

Class XmpWriter

public class XmpWriter extends Object

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.
Field Summary
protected Stringabout
The about string that goes into the rdf:Description tags.
protected charend
The end attribute.
protected intextraSpace
You can add some extra space in the XMP packet; 1 unit in this variable represents 100 spaces and a newline.
static StringEXTRASPACE
String used to fill the extra space.
static StringUTF16
A possible charset for the XMP.
static StringUTF16BE
A possible charset for the XMP.
static StringUTF16LE
A possible charset for the XMP.
static StringUTF8
A possible charset for the XMP.
protected OutputStreamWriterwriter
The writer to which you can write bytes for the XMP stream.
Constructor Summary
XmpWriter(OutputStream os, String utfEncoding, int extraSpace)
Creates an XmpWriter.
XmpWriter(OutputStream os)
Creates an XmpWriter.
XmpWriter(OutputStream os, PdfDictionary info, int PdfXConformance)
XmpWriter(OutputStream os, Map info)
Method Summary
voidaddRdfDescription(String xmlns, String content)
Adds an rdf:Description.
voidaddRdfDescription(XmpSchema s)
Adds an rdf:Description.
voidclose()
Flushes and closes the XmpWriter.
voidsetAbout(String about)
voidsetReadOnly()
Sets the XMP to read-only

Field Detail

about

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

end

protected char end
The end attribute.

extraSpace

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

EXTRASPACE

public static final String EXTRASPACE
String used to fill the extra space.

UTF16

public static final String UTF16
A possible charset for the XMP.

UTF16BE

public static final String UTF16BE
A possible charset for the XMP.

UTF16LE

public static final String UTF16LE
A possible charset for the XMP.

UTF8

public static final String UTF8
A possible charset for the XMP.

writer

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

Constructor Detail

XmpWriter

public XmpWriter(OutputStream os, String utfEncoding, int extraSpace)
Creates an XmpWriter.

Parameters: os utfEncoding extraSpace

Throws: IOException

XmpWriter

public XmpWriter(OutputStream os)
Creates an XmpWriter.

Parameters: os

Throws: IOException

XmpWriter

public XmpWriter(OutputStream os, PdfDictionary info, int PdfXConformance)

Parameters: os info

Throws: IOException

XmpWriter

public XmpWriter(OutputStream os, Map info)

Parameters: os info

Throws: IOException

Method Detail

addRdfDescription

public void addRdfDescription(String xmlns, String content)
Adds an rdf:Description.

Parameters: xmlns content

Throws: IOException

addRdfDescription

public void addRdfDescription(XmpSchema s)
Adds an rdf:Description.

Parameters: s

Throws: IOException

close

public void close()
Flushes and closes the XmpWriter.

Throws: IOException

setAbout

public void setAbout(String about)

Parameters: about The about to set.

setReadOnly

public void setReadOnly()
Sets the XMP to read-only