Class XmpWriter

java.lang.Object
com.aowagie.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 Details

    • UTF8

      private static final String UTF8
      A possible charset for the XMP.
    • EXTRASPACE

      static final String EXTRASPACE
      String used to fill the extra space.
      See Also:
    • extraSpace

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

      private final OutputStreamWriter writer
      The writer to which you can write bytes for the XMP stream.
    • about

      private String about
      The about string that goes into the rdf:Description tags.
    • XPACKET_PI_BEGIN

      static final String XPACKET_PI_BEGIN
      Processing Instruction required at the start of an XMP stream
      Since:
      iText 2.1.6
      See Also:
    • XPACKET_PI_END_W

      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:
    • XPACKET_PI_END_R

      private 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:
    • end

      private final char end
      The end attribute.
      See Also:
  • Constructor Details

    • XmpWriter

      private XmpWriter(OutputStream os, String utfEncoding, int extraSpace) throws IOException
      Creates an XmpWriter.
      Parameters:
      os -
      utfEncoding -
      extraSpace -
      Throws:
      IOException
    • XmpWriter

      public XmpWriter(OutputStream os) throws IOException
      Creates an XmpWriter.
      Parameters:
      os - output stream to set
      Throws:
      IOException - Exception with a IO error
    • XmpWriter

      public XmpWriter(OutputStream os, PdfDictionary info, int PdfXConformance) throws IOException
      Parameters:
      os - output stream to set
      info - info to set
      PdfXConformance - pdf to set
      Throws:
      IOException - Exception with a IO error
  • Method Details

    • setAbout

      public void setAbout(String about)
      Parameters:
      about - The about to set.
    • addRdfDescription

      public void addRdfDescription(XmpSchema s) throws IOException
      Adds an rdf:Description.
      Parameters:
      s - schema to set
      Throws:
      IOException - Exception with a IO error
    • close

      public void close() throws IOException
      Flushes and closes the XmpWriter.
      Throws:
      IOException - Exception with a IO error