Package com.lowagie.text.xml.xmp
Class XmpWriter
java.lang.Object
com.lowagie.text.xml.xmp.XmpWriter
- All Implemented Interfaces:
AutoCloseable
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
FieldsModifier and TypeFieldDescriptionprotected String
The about string that goes into the rdf:Description tags.protected char
The end attribute.protected int
You can add some extra space in the XMP packet; 1 unit in this variable represents 100 spaces and a newline.static final String
String used to fill the extra space.static final String
A possible charset for the XMP.static final String
A possible charset for the XMP.static final String
A possible charset for the XMP.static final String
A possible charset for the XMP.protected OutputStreamWriter
The writer to which you can write bytes for the XMP stream.static final String
Processing Instruction required at the start of an XMP streamstatic final String
Processing Instruction required at the end of an XMP stream for XMP streams that are read onlystatic final String
Processing Instruction required at the end of an XMP stream for XMP streams that can be updated -
Constructor Summary
ConstructorsConstructorDescriptionCreates 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
Modifier and TypeMethodDescriptionvoid
Adds an rdf:Description.void
addRdfDescription
(String xmlns, String content) Adds an rdf:Description.void
close()
Flushes and closes the XmpWriter.void
void
Sets the XMP to read-only
-
Field Details
-
UTF8
A possible charset for the XMP.- See Also:
-
UTF16
A possible charset for the XMP.- See Also:
-
UTF16BE
A possible charset for the XMP.- See Also:
-
UTF16LE
A possible charset for the XMP.- See Also:
-
EXTRASPACE
String used to fill the extra space.- See Also:
-
XPACKET_PI_BEGIN
Processing Instruction required at the start of an XMP stream- Since:
- iText 2.1.6
- See Also:
-
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:
-
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:
-
extraSpace
protected int extraSpaceYou can add some extra space in the XMP packet; 1 unit in this variable represents 100 spaces and a newline. -
writer
The writer to which you can write bytes for the XMP stream. -
about
The about string that goes into the rdf:Description tags. -
end
protected char endThe end attribute.
-
-
Constructor Details
-
XmpWriter
Creates an XmpWriter.- Parameters:
os
- output streamutfEncoding
- utf encoding to be usedextraSpace
- extra space- Throws:
IOException
- on error
-
XmpWriter
Creates an XmpWriter.- Parameters:
os
- output stream- Throws:
IOException
- on error
-
XmpWriter
- Parameters:
os
- output streaminfo
-PdfDictionary
PdfXConformance
- pdf conformance eg. valuesPdfWriter.PDFA1A
,PdfWriter.PDFA1B
- Throws:
IOException
- on error
-
XmpWriter
- Parameters:
os
- output streaminfo
- map of info- Throws:
IOException
- on error
-
-
Method Details
-
setReadOnly
public void setReadOnly()Sets the XMP to read-only -
setAbout
- Parameters:
about
- The about to set.
-
addRdfDescription
Adds an rdf:Description.- Parameters:
xmlns
- xml namespacecontent
- content- Throws:
IOException
- on error
-
addRdfDescription
Adds an rdf:Description.- Parameters:
s
- xmp schema- Throws:
IOException
- on error
-
close
Flushes and closes the XmpWriter.- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
- on error
-