Package com.lowagie.text.xml.xmp
Class XmpWriter
- java.lang.Object
-
- com.lowagie.text.xml.xmp.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
Fields Modifier and Type Field Description protected StringaboutThe about string that goes into the rdf:Description tags.protected charendThe end attribute.protected intextraSpaceYou can add some extra space in the XMP packet; 1 unit in this variable represents 100 spaces and a newline.static StringEXTRASPACEString used to fill the extra space.static StringUTF16A possible charset for the XMP.static StringUTF16BEA possible charset for the XMP.static StringUTF16LEA possible charset for the XMP.static StringUTF8A possible charset for the XMP.protected OutputStreamWriterwriterThe writer to which you can write bytes for the XMP stream.static StringXPACKET_PI_BEGINProcessing Instruction required at the start of an XMP streamstatic StringXPACKET_PI_END_RProcessing Instruction required at the end of an XMP stream for XMP streams that are read onlystatic StringXPACKET_PI_END_WProcessing Instruction required at the end of an XMP stream for XMP streams that can be updated
-
Constructor Summary
Constructors Constructor Description XmpWriter(OutputStream os)Creates an XmpWriter.XmpWriter(OutputStream os, PdfDictionary info, int PdfXConformance)XmpWriter(OutputStream os, String utfEncoding, int extraSpace)Creates an XmpWriter.XmpWriter(OutputStream os, Map info)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRdfDescription(XmpSchema s)Adds an rdf:Description.voidaddRdfDescription(String xmlns, String content)Adds an rdf:Description.voidclose()Flushes and closes the XmpWriter.voidsetAbout(String about)voidsetReadOnly()Sets the XMP to read-only
-
-
-
Field Detail
-
UTF8
public static final String UTF8
A possible charset for the XMP.- See Also:
- Constant Field Values
-
UTF16
public static final String UTF16
A possible charset for the XMP.- See Also:
- Constant Field Values
-
UTF16BE
public static final String UTF16BE
A possible charset for the XMP.- See Also:
- Constant Field Values
-
UTF16LE
public static final String UTF16LE
A possible charset for the XMP.- See Also:
- Constant Field Values
-
EXTRASPACE
public static final String EXTRASPACE
String used to fill the extra space.- See Also:
- Constant Field Values
-
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.
-
writer
protected OutputStreamWriter writer
The writer to which you can write bytes for the XMP stream.
-
about
protected String about
The about string that goes into the rdf:Description tags.
-
XPACKET_PI_BEGIN
public static final String XPACKET_PI_BEGIN
Processing Instruction required at the start of an XMP stream- Since:
- iText 2.1.6
- See Also:
- Constant Field Values
-
XPACKET_PI_END_W
public static final 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
- See Also:
- Constant Field Values
-
XPACKET_PI_END_R
public static final 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
- See Also:
- Constant Field Values
-
end
protected char end
The end attribute.
-
-
Constructor Detail
-
XmpWriter
public XmpWriter(OutputStream os, String utfEncoding, int extraSpace) throws IOException
Creates an XmpWriter.- Parameters:
os- output streamutfEncoding- utf encoding to be usedextraSpace- extra space- Throws:
IOException- on error
-
XmpWriter
public XmpWriter(OutputStream os) throws IOException
Creates an XmpWriter.- Parameters:
os- output stream- Throws:
IOException- on error
-
XmpWriter
public XmpWriter(OutputStream os, PdfDictionary info, int PdfXConformance) throws IOException
- Parameters:
os- output streaminfo-PdfDictionaryPdfXConformance- pdf conformance eg. valuesPdfWriter.PDFA1A,PdfWriter.PDFA1B- Throws:
IOException- on error
-
XmpWriter
public XmpWriter(OutputStream os, Map info) throws IOException
- Parameters:
os- output streaminfo- map of info- Throws:
IOException- on error
-
-
Method Detail
-
setReadOnly
public void setReadOnly()
Sets the XMP to read-only
-
setAbout
public void setAbout(String about)
- Parameters:
about- The about to set.
-
addRdfDescription
public void addRdfDescription(String xmlns, String content) throws IOException
Adds an rdf:Description.- Parameters:
xmlns- xml namespacecontent- content- Throws:
IOException- on error
-
addRdfDescription
public void addRdfDescription(XmpSchema s) throws IOException
Adds an rdf:Description.- Parameters:
s- xmp schema- Throws:
IOException- on error
-
close
public void close() throws IOExceptionFlushes and closes the XmpWriter.- Throws:
IOException- on error
-
-