Class: Arrolio::Renderer::XmpBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/arrolio/renderer/xmp_builder.rb

Overview

Builds an XMP metadata packet (RDF/XML wrapped in xpacket processing instructions). XMP carries Dublin Core properties (dc:title, dc:creator) alongside PDF-specific properties (pdf:Producer, xmp:CreatorTool). The packet is stored as a stream on the PDF catalog's /Metadata entry.

Constant Summary collapse

XPACKET_BEGIN =
'<?xpacket begin="\xEF\xBB\xBF" id="W5M0MpCehiHzreSzNTczkc9d"?>'
XPACKET_END =
'<?xpacket end="w"?>'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata = {}) ⇒ XmpBuilder

Returns a new instance of XmpBuilder.



16
17
18
# File 'lib/arrolio/renderer/xmp_builder.rb', line 16

def initialize( = {})
  @metadata = 
end

Instance Attribute Details

#metadataObject (readonly)

Returns the value of attribute metadata.



14
15
16
# File 'lib/arrolio/renderer/xmp_builder.rb', line 14

def 
  @metadata
end

Instance Method Details

#buildObject



20
21
22
# File 'lib/arrolio/renderer/xmp_builder.rb', line 20

def build
  [XPACKET_BEGIN, xmp_body, XPACKET_END].join("\n")
end