Class: Arrolio::Renderer::XmpBuilder
- Inherits:
-
Object
- Object
- Arrolio::Renderer::XmpBuilder
- 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
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(metadata = {}) ⇒ XmpBuilder
constructor
A new instance of XmpBuilder.
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
#metadata ⇒ Object (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
#build ⇒ Object
20 21 22 |
# File 'lib/arrolio/renderer/xmp_builder.rb', line 20 def build [XPACKET_BEGIN, xmp_body, XPACKET_END].join("\n") end |