Class: Pdfrb::Document::Metadata
- Inherits:
-
Object
- Object
- Pdfrb::Document::Metadata
- Defined in:
- lib/pdfrb/document/metadata.rb
Overview
Document metadata facade. Reads/writes Title, Author, Subject, Keywords, Creator, Producer, CreationDate, ModDate via the trailer's /Info dict (PDF 1.x) and prefers /Catalog/Metadata XMP for PDF 2.0 per App Note 003.
Constant Summary collapse
- STANDARD_FIELDS =
%i[Title Author Subject Keywords Creator Producer CreationDate ModDate Trapped].freeze
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
Instance Method Summary collapse
- #[](field) ⇒ Object
- #[]=(field, value) ⇒ Object
-
#initialize(document) ⇒ Metadata
constructor
A new instance of Metadata.
Constructor Details
#initialize(document) ⇒ Metadata
Returns a new instance of Metadata.
15 16 17 |
# File 'lib/pdfrb/document/metadata.rb', line 15 def initialize(document) @document = document end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
13 14 15 |
# File 'lib/pdfrb/document/metadata.rb', line 13 def document @document end |
Instance Method Details
#[](field) ⇒ Object
24 25 26 |
# File 'lib/pdfrb/document/metadata.rb', line 24 def [](field) read_field(field) end |
#[]=(field, value) ⇒ Object
28 29 30 |
# File 'lib/pdfrb/document/metadata.rb', line 28 def []=(field, value) write_field(field, value) end |