def create_metadata(info = {})
            skeleton = <<-XMP
            <?packet begin="\xef\xbb\xbf" id="W5M0MpCehiHzreSzNTczkc9d"?>
              <x:xmpmeta xmlns:x="adobe:ns:meta/">
                <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
                  <rdf:Description rdf:about="" xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
                  </rdf:Description>
                </rdf:RDF>
              </x:xmpmeta>
            <?xpacket end="w"?>
            XMP

            xml =
                if self.Catalog.Metadata.is_a?(Stream)
                    self.Catalog.Metadata.data
                else
                    skeleton
                end

            doc = REXML::Document.new(xml)
            desc = doc.elements['*/*/rdf:Description']

            info.each do |name, value|
                elt = REXML::Element.new "pdf:#{name}"
                elt.text = value

                desc.elements << elt
            end

            xml = ""; doc.write(xml, 4)

            if self.Catalog.Metadata.is_a?(Stream)
                self.Catalog.Metadata.data = xml
            else
               self.Catalog.Metadata = Stream.new(xml)
            end

            self.Catalog.Metadata
        end
def create_metadata(info = {})
            skeleton = <<-XMP
            <?packet begin="\xef\xbb\xbf" id="W5M0MpCehiHzreSzNTczkc9d"?>
              <x:xmpmeta xmlns:x="adobe:ns:meta/">
                <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
                  <rdf:Description rdf:about="" xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
                  </rdf:Description>
                </rdf:RDF>
              </x:xmpmeta>
            <?xpacket end="w"?>
            XMP

            xml =
                if self.Catalog.Metadata.is_a?(Stream)
                    self.Catalog.Metadata.data
                else
                    skeleton
                end

            doc = REXML::Document.new(xml)
            desc = doc.elements['*/*/rdf:Description']

            info.each do |name, value|
                elt = REXML::Element.new "pdf:#{name}"
                elt.text = value

                desc.elements << elt
            end

            xml = ""; doc.write(xml, 4)

            if self.Catalog.Metadata.is_a?(Stream)
                self.Catalog.Metadata.data = xml
            else
               self.Catalog.Metadata = Stream.new(xml)
            end

            self.Catalog.Metadata
        end
Modifies or creates a metadata stream.