Class: Pdfrb::XMP::Packet
- Inherits:
-
Object
- Object
- Pdfrb::XMP::Packet
- Defined in:
- lib/pdfrb/xmp/packet.rb
Overview
XMP packet wrapper. An XMP packet is an XML document wrapped in processing instructions: ... .
The packet contains an RDF document with one Description element per schema. This class assembles the schemas into a single RDF Description and wraps it in the packet PI.
Constant Summary collapse
- XMP_BEGIN =
"<?xpacket begin=\"\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?>\n"- XMP_END =
"<?xpacket end=\"w\"?>\n"
Instance Attribute Summary collapse
-
#dc ⇒ Object
readonly
Returns the value of attribute dc.
-
#pdf ⇒ Object
readonly
Returns the value of attribute pdf.
-
#rights ⇒ Object
readonly
Returns the value of attribute rights.
-
#xmp ⇒ Object
readonly
Returns the value of attribute xmp.
Instance Method Summary collapse
- #author ⇒ Object
- #author=(value) ⇒ Object
- #creator ⇒ Object
- #creator=(value) ⇒ Object
- #creator_tool ⇒ Object
- #creator_tool=(value) ⇒ Object
- #description ⇒ Object
- #description=(value) ⇒ Object
-
#initialize ⇒ Packet
constructor
A new instance of Packet.
- #keywords ⇒ Object
- #keywords=(value) ⇒ Object
- #pdfa_conformance ⇒ Object
-
#pdfa_id=(value) ⇒ Object
PDF/A identification (ISO 19005-1 s6.7.11 / 19005-2 s6.6.4): part (e.g. 2) and conformance level ("A", "B", "U").
- #pdfa_part ⇒ Object
- #producer ⇒ Object
- #producer=(value) ⇒ Object
- #subject ⇒ Object
- #subject=(value) ⇒ Object
- #title ⇒ Object
- #title=(value) ⇒ Object
- #to_xmp ⇒ Object
Constructor Details
Instance Attribute Details
#dc ⇒ Object (readonly)
Returns the value of attribute dc.
17 18 19 |
# File 'lib/pdfrb/xmp/packet.rb', line 17 def dc @dc end |
#pdf ⇒ Object (readonly)
Returns the value of attribute pdf.
17 18 19 |
# File 'lib/pdfrb/xmp/packet.rb', line 17 def pdf @pdf end |
#rights ⇒ Object (readonly)
Returns the value of attribute rights.
17 18 19 |
# File 'lib/pdfrb/xmp/packet.rb', line 17 def rights @rights end |
#xmp ⇒ Object (readonly)
Returns the value of attribute xmp.
17 18 19 |
# File 'lib/pdfrb/xmp/packet.rb', line 17 def xmp @xmp end |
Instance Method Details
#author ⇒ Object
33 |
# File 'lib/pdfrb/xmp/packet.rb', line 33 def ; @dc.creator.first; end |
#author=(value) ⇒ Object
32 |
# File 'lib/pdfrb/xmp/packet.rb', line 32 def (value); @dc.creator = Array(value); end |
#creator ⇒ Object
30 |
# File 'lib/pdfrb/xmp/packet.rb', line 30 def creator; @dc.creator.first; end |
#creator=(value) ⇒ Object
29 |
# File 'lib/pdfrb/xmp/packet.rb', line 29 def creator=(value); @dc.creator = Array(value); end |
#creator_tool ⇒ Object
45 |
# File 'lib/pdfrb/xmp/packet.rb', line 45 def creator_tool; @xmp.creator_tool; end |
#creator_tool=(value) ⇒ Object
44 |
# File 'lib/pdfrb/xmp/packet.rb', line 44 def creator_tool=(value); @xmp.creator_tool = value; end |
#description ⇒ Object
35 |
# File 'lib/pdfrb/xmp/packet.rb', line 35 def description; @dc.description.first; end |
#description=(value) ⇒ Object
34 |
# File 'lib/pdfrb/xmp/packet.rb', line 34 def description=(value); @dc.description = Array(value); end |
#keywords ⇒ Object
40 |
# File 'lib/pdfrb/xmp/packet.rb', line 40 def keywords; @pdf.keywords; end |
#keywords=(value) ⇒ Object
39 |
# File 'lib/pdfrb/xmp/packet.rb', line 39 def keywords=(value); @pdf.keywords = value; end |
#pdfa_conformance ⇒ Object
54 |
# File 'lib/pdfrb/xmp/packet.rb', line 54 def pdfa_conformance; @pdfaid && @pdfaid[:conformance]; end |
#pdfa_id=(value) ⇒ Object
PDF/A identification (ISO 19005-1 s6.7.11 / 19005-2 s6.6.4): part (e.g. 2) and conformance level ("A", "B", "U").
49 50 51 |
# File 'lib/pdfrb/xmp/packet.rb', line 49 def pdfa_id=(value) @pdfaid = { part: Integer(value[:part]), conformance: value[:conformance].to_s } end |
#pdfa_part ⇒ Object
53 |
# File 'lib/pdfrb/xmp/packet.rb', line 53 def pdfa_part; @pdfaid && @pdfaid[:part]; end |
#producer ⇒ Object
42 |
# File 'lib/pdfrb/xmp/packet.rb', line 42 def producer; @pdf.producer; end |
#producer=(value) ⇒ Object
41 |
# File 'lib/pdfrb/xmp/packet.rb', line 41 def producer=(value); @pdf.producer = value; end |
#subject ⇒ Object
37 |
# File 'lib/pdfrb/xmp/packet.rb', line 37 def subject; @dc.subject; end |
#subject=(value) ⇒ Object
36 |
# File 'lib/pdfrb/xmp/packet.rb', line 36 def subject=(value); @dc.subject = Array(value); end |
#title ⇒ Object
28 |
# File 'lib/pdfrb/xmp/packet.rb', line 28 def title; @dc.title.first; end |
#title=(value) ⇒ Object
27 |
# File 'lib/pdfrb/xmp/packet.rb', line 27 def title=(value); @dc.title = Array(value); end |