pdfrb 0.7.18 → 0.7.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pdfrb/model/type/action_go_to_3d_view.rb +1 -0
  3. data/lib/pdfrb/model/type/action_go_to_dp.rb +1 -0
  4. data/lib/pdfrb/model/type/action_go_to_r.rb +1 -0
  5. data/lib/pdfrb/model/type/action_goto.rb +15 -3
  6. data/lib/pdfrb/model/type/action_hide.rb +1 -0
  7. data/lib/pdfrb/model/type/action_import_data.rb +1 -0
  8. data/lib/pdfrb/model/type/action_java_script.rb +1 -0
  9. data/lib/pdfrb/model/type/action_launch.rb +1 -0
  10. data/lib/pdfrb/model/type/action_movie.rb +1 -0
  11. data/lib/pdfrb/model/type/action_named.rb +1 -0
  12. data/lib/pdfrb/model/type/action_nop.rb +1 -0
  13. data/lib/pdfrb/model/type/action_rendition.rb +1 -0
  14. data/lib/pdfrb/model/type/action_reset_form.rb +1 -0
  15. data/lib/pdfrb/model/type/action_set_ocg_state.rb +1 -0
  16. data/lib/pdfrb/model/type/action_set_state.rb +1 -0
  17. data/lib/pdfrb/model/type/action_submit_form.rb +1 -0
  18. data/lib/pdfrb/model/type/action_trans.rb +1 -0
  19. data/lib/pdfrb/model/type/action_uri.rb +1 -0
  20. data/lib/pdfrb/model/type/appearance.rb +6 -3
  21. data/lib/pdfrb/model/type/appearance_characteristics.rb +1 -0
  22. data/lib/pdfrb/model/type/appearance_trap_net.rb +1 -0
  23. data/lib/pdfrb/model/type/caret_annotation.rb +1 -0
  24. data/lib/pdfrb/model/type/circle_annotation.rb +1 -0
  25. data/lib/pdfrb/model/type/d_part.rb +91 -0
  26. data/lib/pdfrb/model/type/dss.rb +81 -0
  27. data/lib/pdfrb/model/type/file_attachment_annotation.rb +1 -0
  28. data/lib/pdfrb/model/type/free_text_annotation.rb +1 -0
  29. data/lib/pdfrb/model/type/highlight_annotation.rb +1 -0
  30. data/lib/pdfrb/model/type/ink_annotation.rb +1 -0
  31. data/lib/pdfrb/model/type/line_annotation.rb +17 -4
  32. data/lib/pdfrb/model/type/link_annotation.rb +1 -0
  33. data/lib/pdfrb/model/type/polygon_annotation.rb +1 -0
  34. data/lib/pdfrb/model/type/polyline_annotation.rb +1 -0
  35. data/lib/pdfrb/model/type/popup_annotation.rb +1 -0
  36. data/lib/pdfrb/model/type/printer_mark_annotation.rb +1 -0
  37. data/lib/pdfrb/model/type/redact_annotation.rb +1 -0
  38. data/lib/pdfrb/model/type/rich_media_annotation.rb +1 -0
  39. data/lib/pdfrb/model/type/screen_annotation.rb +1 -0
  40. data/lib/pdfrb/model/type/sound_annotation.rb +1 -0
  41. data/lib/pdfrb/model/type/square_annotation.rb +1 -0
  42. data/lib/pdfrb/model/type/squiggly_annotation.rb +1 -0
  43. data/lib/pdfrb/model/type/stamp_annotation.rb +1 -0
  44. data/lib/pdfrb/model/type/strikeout_annotation.rb +1 -0
  45. data/lib/pdfrb/model/type/text_annotation.rb +1 -0
  46. data/lib/pdfrb/model/type/three_d_activation.rb +1 -0
  47. data/lib/pdfrb/model/type/three_d_animation_style.rb +1 -0
  48. data/lib/pdfrb/model/type/three_d_background.rb +1 -0
  49. data/lib/pdfrb/model/type/three_d_cross_section.rb +1 -0
  50. data/lib/pdfrb/model/type/three_d_lighting_scheme.rb +1 -0
  51. data/lib/pdfrb/model/type/three_d_measure_3dc.rb +1 -0
  52. data/lib/pdfrb/model/type/three_d_measure_ad3.rb +1 -0
  53. data/lib/pdfrb/model/type/three_d_measure_ld3.rb +1 -0
  54. data/lib/pdfrb/model/type/three_d_measure_pd3.rb +1 -0
  55. data/lib/pdfrb/model/type/three_d_measure_rd3.rb +1 -0
  56. data/lib/pdfrb/model/type/three_d_node.rb +1 -0
  57. data/lib/pdfrb/model/type/three_d_reference.rb +1 -0
  58. data/lib/pdfrb/model/type/three_d_render_mode.rb +1 -0
  59. data/lib/pdfrb/model/type/three_d_stream.rb +1 -0
  60. data/lib/pdfrb/model/type/three_d_units.rb +1 -0
  61. data/lib/pdfrb/model/type/three_d_view.rb +1 -0
  62. data/lib/pdfrb/model/type/underline_annotation.rb +1 -0
  63. data/lib/pdfrb/model/type/watermark_annotation.rb +1 -0
  64. data/lib/pdfrb/model/type.rb +7 -0
  65. data/lib/pdfrb/version.rb +1 -1
  66. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10ae262fc764f359b2eebcfa7384fd94fb41094fc906987fcba0f254fecd0e11
4
- data.tar.gz: 6ca04beff81f5a83621caeeff912aa0d4dd4268e1141a8aa8b49479a0efa2465
3
+ metadata.gz: a799578418324e198b38930d7dce57663503478adb1b529c608d58183f84f183
4
+ data.tar.gz: 94b49f8a02ce9845ad283afa39ec4224ce0ecef9240919c21909e38f18f52ccd
5
5
  SHA512:
6
- metadata.gz: c301c11937103aadbbc335c10649dd2bc8dd5d2b0b12d6673a8b43f5d3961f54362f4fcc8433e69a82fcabc7f2f9c4b123025b556892e9ba423f3af88a59695b
7
- data.tar.gz: f9a1cebbde8c0465ae6574d744aa0b4eb059e4e4f594aef81d59f377209fdbc11c7fcf7db2431ff460ea80e211e807b806fbf02b59e6ecd2167c4ee707dabbb7
6
+ metadata.gz: 1d2bdf98564008508094b7c6165160541419331edd629f2dd836dc4632b1f99830e0b8d3b9490cd3395ebc5e0674c40f8ce99bf42b079ff9f8ab7c3b13e8180a
7
+ data.tar.gz: 984567fb69359980624147608deeeed46c9a345a0ec4f97158924629d1bf78f8c3a6be5dba5cfc1c6a36d930865a55d33a5c5d0fa17922fb4c16726d1142f037
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # GoTo3DView action (s12.6.4.12, PDF 1.6+). Navigate within a 3D stream.
7
7
  class ActionGoTo3DView < Action
8
+ arlington_object "ActionGoTo3DView"
8
9
  register_subtype :GoTo3DView
9
10
 
10
11
  def target_view; self[:TA]; end
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # GoToDp action (s12.6.4.2, PDF 2.0). Destination pointer variant
7
7
  # of GoTo that supports /DP (destination page) over a /D array.
8
8
  class ActionGoToDp < Action
9
+ arlington_object "ActionGoToDp"
9
10
  register_subtype :GoToDp
10
11
 
11
12
  def destination_page; self[:DP]; end
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # Remote GoTo action (s12.6.4.3). Navigate to a destination in
7
7
  # another PDF file.
8
8
  class ActionGoToR < Action
9
+ arlington_object "ActionGoToR"
9
10
  register_subtype :GoToR
10
11
 
11
12
  def file_spec; self[:F]; end
@@ -5,12 +5,14 @@ module Pdfrb
5
5
  module Type
6
6
  # GoTo action (s12.6.4.2). Navigate to a destination.
7
7
  class ActionGoTo < Action
8
+ arlington_object "ActionGoTo"
8
9
  register_subtype :GoTo
9
10
 
10
11
  def destination; self[:D]; end
11
12
 
12
13
  def page_index_destination?
13
- destination.is_a?(Array) && destination.first.is_a?(Integer)
14
+ d = destination_array
15
+ !d.nil? && d.first.is_a?(Integer)
14
16
  end
15
17
 
16
18
  def named_destination?
@@ -20,13 +22,23 @@ module Pdfrb
20
22
  def target_page_number
21
23
  return nil unless page_index_destination?
22
24
 
23
- destination.first
25
+ destination_array.first
24
26
  end
25
27
 
26
28
  def display_option
27
29
  return nil unless page_index_destination?
28
30
 
29
- destination[1..]
31
+ destination_array[1..]
32
+ end
33
+
34
+ private
35
+
36
+ def destination_array
37
+ d = destination
38
+ return d.to_a if d.is_a?(Pdfrb::Model::PdfArray)
39
+ return d if d.is_a?(::Array)
40
+
41
+ nil
30
42
  end
31
43
  end
32
44
  end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Hide action (s12.6.4.10). Show/hide annotations.
7
7
  class ActionHide < Action
8
+ arlington_object "ActionHide"
8
9
  register_subtype :Hide
9
10
 
10
11
  def targets; self[:T]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Import-data action (s12.7.6.4). Imports form data from an FDF/XFDF file.
7
7
  class ActionImportData < Action
8
+ arlington_object "ActionImportData"
8
9
  register_subtype :ImportData
9
10
 
10
11
  def file_spec; self[:F]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # JavaScript action (s12.6.4.16). Execute JavaScript code.
7
7
  class ActionJavaScript < Action
8
+ arlington_object "ActionECMAScript"
8
9
  register_subtype :JavaScript
9
10
 
10
11
  def script; self[:JS]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Launch action (s12.6.4.5). Launch an external application.
7
7
  class ActionLaunch < Action
8
+ arlington_object "ActionLaunch"
8
9
  register_subtype :Launch
9
10
 
10
11
  def file_spec; self[:F]; end
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # Movie action (s12.6.4.8). Deprecated in PDF 2.0 but still
7
7
  # appears in legacy PDFs. Plays/stops a Movie annotation.
8
8
  class ActionMovie < Action
9
+ arlington_object "ActionMovie"
9
10
  register_subtype :Movie
10
11
 
11
12
  def annotation; self[:Annotation]; end
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # Named action (s12.6.4.19). Pre-defined action by name (NextPage,
7
7
  # PrevPage, FirstPage, LastPage, Print, etc.).
8
8
  class ActionNamed < Action
9
+ arlington_object "ActionNamed"
9
10
  register_subtype :Named
10
11
 
11
12
  def action_name; self[:N]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # NOP action (PDF 1.2 deprecated). No-op placeholder.
7
7
  class ActionNOP < Action
8
+ arlington_object "ActionNOP"
8
9
  register_subtype :NOP
9
10
  end
10
11
  end
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # Rendition action (s12.6.4.12). Controls multimedia rendition
7
7
  # on screen annotations.
8
8
  class ActionRendition < Action
9
+ arlington_object "ActionRendition"
9
10
  register_subtype :Rendition
10
11
 
11
12
  def rendition; self[:R]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Reset-form action (s12.7.6.3). Resets form fields to defaults.
7
7
  class ActionResetForm < Action
8
+ arlington_object "ActionResetForm"
8
9
  register_subtype :ResetForm
9
10
 
10
11
  def fields; self[:Fields]; end
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # Set OCG State action (s12.6.4.13). Toggle visibility of
7
7
  # optional-content groups.
8
8
  class ActionSetOCGState < Action
9
+ arlington_object "ActionSetOCGState"
9
10
  register_subtype :SetOCGState
10
11
 
11
12
  def state; self[:State]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Set-state action (deprecated in PDF 1.2, replaced by SetOCGState).
7
7
  class ActionSetState < Action
8
+ arlington_object "ActionSetState"
8
9
  register_subtype :SetState
9
10
 
10
11
  def state; self[:State]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Submit-form action (s12.7.6.2). Submits form values to a URL.
7
7
  class ActionSubmitForm < Action
8
+ arlington_object "ActionSubmitForm"
8
9
  register_subtype :SubmitForm
9
10
 
10
11
  def url; self[:F]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Transition action (s12.4.3). Specifies page transition for slide-show.
7
7
  class ActionTrans < Action
8
+ arlington_object "ActionTransition"
8
9
  register_subtype :Trans
9
10
 
10
11
  def transition; self[:Trans]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # URI action (s12.6.4.7). Opens a URL in the browser.
7
7
  class ActionURI < Action
8
+ arlington_object "ActionURI"
8
9
  register_subtype :URI
9
10
 
10
11
  def uri; self[:URI]; end
@@ -7,20 +7,23 @@ module Pdfrb
7
7
  # annotation holds three sub-dicts: /N (normal), /R (rollover),
8
8
  # /D (down).
9
9
  class Appearance < Pdfrb::Model::Cos::Dictionary
10
+ arlington_object "Appearance"
10
11
  def normal; self[:N]; end
11
12
  def rollover; self[:R]; end
12
13
  def down; self[:D]; end
13
14
 
15
+ # Presence checks use the raw value (not the Arlington
16
+ # default) because /D defaults to /N's value per the spec.
14
17
  def has_normal?
15
- !!normal
18
+ !value[:N].nil?
16
19
  end
17
20
 
18
21
  def has_rollover?
19
- !!rollover
22
+ !value[:R].nil?
20
23
  end
21
24
 
22
25
  def has_down?
23
- !!down
26
+ !value[:D].nil?
24
27
  end
25
28
 
26
29
  def normal_for_state(state_name)
@@ -8,6 +8,7 @@ module Pdfrb
8
8
  # colors, normal/rollover/down captions, etc. Often stored under
9
9
  # the widget's /MK key.
10
10
  class AppearanceCharacteristics < Pdfrb::Model::Cos::Dictionary
11
+ arlington_object "AppearanceCharacteristics"
11
12
  def background_color; self[:BG]; end
12
13
  def caption; self[:CA]; end
13
14
  def rollover_caption; self[:RC]; end
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # AppearanceTrapNet sub-dictionary (s7.7.3.3, Table 327). Per-
7
7
  # appearance-stream trap-net (ink-flattening) parameters.
8
8
  class AppearanceTrapNetSubDict < Pdfrb::Model::Cos::Dictionary
9
+ arlington_object "AppearanceTrapNet"
9
10
  def pos_h; self[:PosH]; end
10
11
  def pos_l; self[:PosL]; end
11
12
  def span_h_min; self[:SpanH]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Caret annotation (s12.5.6.11). Text-insertion indicator.
7
7
  class CaretAnnotation < MarkupAnnotation
8
+ arlington_object "AnnotCaret"
8
9
  def rd; self[:RD]; end
9
10
  def sy; self[:Sy]; end
10
11
 
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Circle / ellipse annotation (s12.5.6.8).
7
7
  class CircleAnnotation < MarkupAnnotation
8
+ arlington_object "AnnotCircle"
8
9
  def border_effect; self[:BE]; end
9
10
  def interior_color; self[:IC]; end
10
11
  def border_style; self[:BS]; end
@@ -0,0 +1,91 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pdfrb
4
+ module Model
5
+ module Type
6
+ # DPartRoot (ISO 16612-2 PDF/VT §6.3.4). The root of the
7
+ # Document Part hierarchy, attached to the Catalog via the
8
+ # /DPartRoot key. Represents the root node of a tree whose
9
+ # leaves are groups of document parts.
10
+ class DPartRoot < Pdfrb::Model::Cos::Dictionary
11
+ arlington_object "DPartRoot"
12
+
13
+ # /Type — optional, fixed "DPartRoot".
14
+ def type
15
+ value[:Type]&.to_sym
16
+ end
17
+
18
+ # /DPartRootNode — required indirect reference to the
19
+ # first DPart child.
20
+ def root_node(document = nil)
21
+ ref = value[:DPartRootNode]
22
+ return nil unless ref && document
23
+
24
+ resolved = ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
25
+ return nil unless resolved && resolved.value.is_a?(::Hash)
26
+
27
+ DPart.new(resolved.value)
28
+ end
29
+
30
+ # /RecordLevel — optional integer >= 0, the nesting depth
31
+ # at which DParts represent individual records.
32
+ def record_level
33
+ value[:RecordLevel]
34
+ end
35
+
36
+ # /NodeNameList — optional array of names identifying the
37
+ # tree levels (required for PDF/VT-2).
38
+ def node_name_list
39
+ value[:NodeNameList]
40
+ end
41
+ end
42
+
43
+ # DPart (ISO 16612-2 PDF/VT §6.3.5). One node in the Document
44
+ # Part hierarchy. Either has /DParts (a tree of child DParts)
45
+ # or /Start + /End pointing to the page range it covers.
46
+ class DPart < Pdfrb::Model::Cos::Dictionary
47
+ arlington_object "DPart"
48
+
49
+ # /Type — optional, fixed "DPart".
50
+ def type
51
+ value[:Type]&.to_sym
52
+ end
53
+
54
+ # /Parent — required indirect ref to the containing DPart
55
+ # or DPartRoot (may be absent when Metadata is present).
56
+ def parent(document = nil)
57
+ ref = value[:Parent]
58
+ return nil unless ref && document
59
+
60
+ ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
61
+ end
62
+
63
+ # /DParts — array of arrays of child DParts. Mutually
64
+ # exclusive with /Start + /End.
65
+ def child_parts
66
+ value[:DParts]
67
+ end
68
+
69
+ # /Start — indirect ref to the first Page in this part.
70
+ def start_page(document = nil)
71
+ ref = value[:Start]
72
+ return nil unless ref && document
73
+
74
+ ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
75
+ end
76
+
77
+ # /End — indirect ref to the last Page in this part.
78
+ def end_page(document = nil)
79
+ ref = value[:End]
80
+ return nil unless ref && document
81
+
82
+ ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
83
+ end
84
+
85
+ def leaf?
86
+ child_parts.nil?
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,81 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pdfrb
4
+ module Model
5
+ module Type
6
+ # DSS (Document Security Store) per ETSI EN 319 142-1 (PAdES)
7
+ # §B.5. Attached to the Catalog via the /DSS key. Holds the
8
+ # long-term validation material: certificates, CRLs, OCSP
9
+ # responses, and per-signature VRI dictionaries.
10
+ class Dss < Pdfrb::Model::Cos::Dictionary
11
+ arlington_object "DSS"
12
+
13
+ # /Type — optional, fixed "DSS".
14
+ def type
15
+ value[:Type]&.to_sym
16
+ end
17
+
18
+ # /Certs — array of indirect streams, each a DER-encoded
19
+ # X.509 certificate used by any signature in the document.
20
+ def certificates(document = nil)
21
+ resolve_streams(value[:Certs], document)
22
+ end
23
+
24
+ # /OCSPs — array of indirect streams, each a DER-encoded
25
+ # OCSP response.
26
+ def ocsp_responses(document = nil)
27
+ resolve_streams(value[:OCSPs], document)
28
+ end
29
+
30
+ # /CRLs — array of indirect streams, each a DER-encoded
31
+ # certificate revocation list.
32
+ def crls(document = nil)
33
+ resolve_streams(value[:CRLs], document)
34
+ end
35
+
36
+ # /VRI — optional map of SHA-1 hex digest -> VRI dict for
37
+ # each signature. Returns the raw Hash.
38
+ def vri_map
39
+ value[:VRI]
40
+ end
41
+
42
+ # Enumerate each (signature-hash, Vri) pair, resolving the
43
+ # VRI dicts to typed instances.
44
+ def each_vri(document = nil)
45
+ return enum_for(:each_vri, document) unless block_given?
46
+
47
+ map = vri_map
48
+ return unless map
49
+
50
+ raw = map.is_a?(Pdfrb::Model::Cos::Dictionary) ? map.value : map
51
+ raw.each do |sig_hash, ref|
52
+ resolved = if ref.is_a?(Pdfrb::Model::Reference) && document
53
+ document.object(ref)
54
+ else
55
+ ref
56
+ end
57
+ next unless resolved && resolved.value.is_a?(::Hash)
58
+
59
+ yield sig_hash.to_s, Vri.new(resolved.value)
60
+ end
61
+ end
62
+
63
+ # Look up a VRI by the hex-encoded SHA-1 digest of the
64
+ # signature's DER bytes.
65
+ def vri_for(signature_sha1_hex, document = nil)
66
+ each_vri(document).find { |h, _v| h == signature_sha1_hex }&.last
67
+ end
68
+
69
+ private
70
+
71
+ def resolve_streams(refs, document)
72
+ return [] unless refs && document
73
+
74
+ arr = refs.is_a?(Pdfrb::Model::PdfArray) ? refs.value : refs
75
+ arr = [arr] unless arr.is_a?(::Array)
76
+ arr.filter_map { |r| r.is_a?(Pdfrb::Model::Reference) ? document.object(r) : r }
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # File-attachment annotation (s12.5.6.15). Embedded file displayed
7
7
  # as a paper-clip icon.
8
8
  class FileAttachmentAnnotation < MarkupAnnotation
9
+ arlington_object "AnnotFileAttachment"
9
10
  def embedded_file; self[:FS]; end
10
11
  def name; self[:Name]; end
11
12
 
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Free-text annotation (s12.5.6.6). Text shown directly on the page.
7
7
  class FreeTextAnnotation < MarkupAnnotation
8
+ arlington_object "AnnotFreeText"
8
9
  def default_appearance; self[:DA]; end
9
10
  def q; self[:Q]; end
10
11
  def rc; self[:RC]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Highlight annotation. /Subtype /Highlight.
7
7
  class HighlightAnnotation < TextMarkupAnnotation
8
+ arlington_object "AnnotHighlight"
8
9
  end
9
10
  end
10
11
  end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Ink annotation (s12.5.6.13). Freehand scribble path(s).
7
7
  class InkAnnotation < MarkupAnnotation
8
+ arlington_object "AnnotInk"
8
9
  def ink_list; self[:InkList]; end
9
10
  def interior_color; self[:IC]; end
10
11
  def border_style; self[:BS]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Line annotation (s12.5.6.7). Line between two coordinate pairs.
7
7
  class LineAnnotation < MarkupAnnotation
8
+ arlington_object "AnnotLine"
8
9
  def line; self[:L]; end
9
10
  def le; self[:LE]; end
10
11
  def line_endings; le; end
@@ -20,15 +21,17 @@ module Pdfrb
20
21
  def it; self[:IT]; end
21
22
 
22
23
  def start_point
23
- return nil unless line.is_a?(Array) && line.size >= 2
24
+ l = line_array
25
+ return nil unless l && l.size >= 2
24
26
 
25
- line[0..1]
27
+ l[0..1]
26
28
  end
27
29
 
28
30
  def end_point
29
- return nil unless line.is_a?(Array) && line.size >= 4
31
+ l = line_array
32
+ return nil unless l && l.size >= 4
30
33
 
31
- line[2..3]
34
+ l[2..3]
32
35
  end
33
36
 
34
37
  def has_caption?
@@ -38,6 +41,16 @@ module Pdfrb
38
41
  def has_measure?
39
42
  !!measure
40
43
  end
44
+
45
+ private
46
+
47
+ def line_array
48
+ l = line
49
+ return l.to_a if l.is_a?(Pdfrb::Model::PdfArray)
50
+ return l if l.is_a?(::Array)
51
+
52
+ nil
53
+ end
41
54
  end
42
55
  end
43
56
  end
@@ -4,6 +4,7 @@ module Pdfrb
4
4
  module Model
5
5
  module Type
6
6
  class LinkAnnotation < Annotation
7
+ arlington_object "AnnotLink"
7
8
  def action; self[:A]; end
8
9
  def destination; self[:Dest]; end
9
10
  def highlight_mode; self[:H]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Polygon annotation (s12.5.6.9). Closed polygon shape.
7
7
  class PolygonAnnotation < MarkupAnnotation
8
+ arlington_object "AnnotPolygon"
8
9
  def vertices; self[:Vertices]; end
9
10
  def line_endings; self[:LE]; end
10
11
  def interior_color; self[:IC]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Polyline annotation (s12.5.6.9). Open polyline (not closed).
7
7
  class PolylineAnnotation < MarkupAnnotation
8
+ arlington_object "AnnotPolyLine"
8
9
  def vertices; self[:Vertices]; end
9
10
  def line_endings; self[:LE]; end
10
11
  def interior_color; self[:IC]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Popup annotation (s12.5.6.14). Displays text/markup in a pop-up window.
7
7
  class PopupAnnotation < Annotation
8
+ arlington_object "AnnotPopup"
8
9
  def parent; self[:Parent]; end
9
10
  def open?; !!value[:Open]; end
10
11
 
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # Printer-mark annotation (s12.5.6.17). Marks page for trimming,
7
7
  # registration, etc.
8
8
  class PrinterMarkAnnotation < Annotation
9
+ arlington_object "AnnotPrinterMark"
9
10
  def mark_subtype; self[:MN]; end
10
11
  end
11
12
  end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Redaction annotation (s12.5.6.16). Marks content for removal.
7
7
  class RedactAnnotation < MarkupAnnotation
8
+ arlington_object "AnnotRedact"
8
9
  def overlay_text; self[:OverlayText]; end
9
10
  def repeat_overlay?; truthy?(self[:Repeat]); end
10
11
  def quadding; self[:Q]; end
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # Rich Media annotation (s12.5.6.20, PDF 1.7 ExtensionLevel 3 +
7
7
  # PDF 2.0). Hosts interactive rich media content (Flash, video).
8
8
  class RichMediaAnnotation < Annotation
9
+ arlington_object "AnnotRichMedia"
9
10
  def rich_media_settings; self[:RichMediaSettings]; end
10
11
  def rich_media_content; self[:RichMediaContent]; end
11
12
 
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # Screen annotation (s12.5.6.18). Holds media played via Action
7
7
  # triggers. /Subtype /Screen.
8
8
  class ScreenAnnotation < Annotation
9
+ arlington_object "AnnotScreen"
9
10
  def attachment_point; self[:AP]; end
10
11
  def media_type; self[:T]; end
11
12
  def actions; self[:AA]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Sound annotation (s12.5.6.18). Sound clip embedded in the page.
7
7
  class SoundAnnotation < MarkupAnnotation
8
+ arlington_object "AnnotSound"
8
9
  def sound; self[:Sound]; end
9
10
  def name; self[:Name]; end
10
11
 
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Square / rectangle annotation (s12.5.6.8).
7
7
  class SquareAnnotation < MarkupAnnotation
8
+ arlington_object "AnnotSquare"
8
9
  def border_effect; self[:BE]; end
9
10
  def interior_color; self[:IC]; end
10
11
  def border_style; self[:BS]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Squiggly annotation. /Subtype /Squiggly.
7
7
  class SquigglyAnnotation < TextMarkupAnnotation
8
+ arlington_object "AnnotSquiggly"
8
9
  end
9
10
  end
10
11
  end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Rubber-stamp annotation (s12.5.6.14).
7
7
  class StampAnnotation < MarkupAnnotation
8
+ arlington_object "AnnotStamp"
8
9
  def name; self[:Name]; end
9
10
  def interior_color; self[:IC]; end
10
11
  def rotation; self[:Rotate] || 0; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # StrikeOut annotation. /Subtype /StrikeOut.
7
7
  class StrikeOutAnnotation < TextMarkupAnnotation
8
+ arlington_object "AnnotStrikeOut"
8
9
  end
9
10
  end
10
11
  end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Sticky note annotation (s12.5.6.10).
7
7
  class TextAnnotation < MarkupAnnotation
8
+ arlington_object "AnnotText"
8
9
  def state; self[:State]; end
9
10
  def state_model; self[:StateModel]; end
10
11
 
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # 3D Activation (s13.6.2). Controls when a 3D stream becomes
7
7
  # active and how it's deactivated.
8
8
  class ThreeDActivation < Pdfrb::Model::Cos::Dictionary
9
+ arlington_object "3DActivation"
9
10
  def activation_mode; self[:A]&.to_sym; end
10
11
  def activation_instance; self[:AIS]&.to_sym; end
11
12
  def deactivation_mode; self[:D]&.to_sym; end
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # 3D Animation Style (s13.6.3, Table 312-313). Animation control
7
7
  # for a 3D stream.
8
8
  class ThreeDAnimationStyle < Pdfrb::Model::Cos::Dictionary
9
+ arlington_object "3DAnimationStyle"
9
10
  def type; self[:Type]; end
10
11
  def subtype; self[:Subtype]&.to_sym; end
11
12
  def play_count; self[:PC] || 0; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # 3D Background (s13.6.4). Background fill for a 3D view.
7
7
  class ThreeDBackground < Pdfrb::Model::Cos::Dictionary
8
+ arlington_object "3DBackground"
8
9
  def type; self[:Type]; end
9
10
  def subtype; self[:Subtype]&.to_sym; end
10
11
  def color_space; self[:CS]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # 3D Cross Section (s13.6.4). Plane cutaway view of a 3D model.
7
7
  class ThreeDCrossSection < Pdfrb::Model::Cos::Dictionary
8
+ arlington_object "3DCrossSection"
8
9
  def type; self[:Type]; end
9
10
  def center; self[:C]; end
10
11
  def orientation; self[:O]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # 3D Lighting Scheme (s13.6.4, Table 320-321). Lighting preset.
7
7
  class ThreeDLightingScheme < Pdfrb::Model::Cos::Dictionary
8
+ arlington_object "3DLightingScheme"
8
9
  def type; self[:Type]; end
9
10
  def subtype; self[:Subtype]&.to_sym; end
10
11
 
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # 3D Comment (3DC) measure (s13.6.4). A 3D measurement note.
7
7
  class ThreeDMeasure3DC < ThreeDMeasure
8
+ arlington_object "3DMeasure3DC"
8
9
  def text; self[:TRL]; end
9
10
  def anchor; self[:A1]; end
10
11
  def name; self[:N1]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # 3D Angle Distance measure (AD3, s13.6.4).
7
7
  class ThreeDMeasureAD3 < ThreeDMeasure
8
+ arlington_object "3DMeasureAD3"
8
9
  def annotation1; self[:A1]; end
9
10
  def annotation2; self[:A2]; end
10
11
  def angle; self[:A]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # 3D Linear Distance measure (LD3, s13.6.4).
7
7
  class ThreeDMeasureLD3 < ThreeDMeasure
8
+ arlington_object "3DMeasureLD3"
8
9
  def annotation1; self[:A1]; end
9
10
  def annotation2; self[:A2]; end
10
11
  def distance; self[:D]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # 3D Perpendicular Distance measure (PD3, s13.6.4).
7
7
  class ThreeDMeasurePD3 < ThreeDMeasure
8
+ arlington_object "3DMeasurePD3"
8
9
  def annotation1; self[:A1]; end
9
10
  def annotation2; self[:A2]; end
10
11
  def distance; self[:D]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # 3D Radial Distance measure (RD3, s13.6.4).
7
7
  class ThreeDMeasureRD3 < ThreeDMeasure
8
+ arlington_object "3DMeasureRD3"
8
9
  def annotation1; self[:A1]; end
9
10
  def annotation2; self[:A2]; end
10
11
  def distance; self[:D]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # 3D Node (s13.6.4). A node in a 3D model's scene graph.
7
7
  class ThreeDNode < Pdfrb::Model::Cos::Dictionary
8
+ arlington_object "3DNode"
8
9
  def type; self[:Type]; end
9
10
  def name; self[:N]; end
10
11
  def opacity; self[:O]; end
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # 3D Reference (s13.6.5). Indirect reference to a 3D stream
7
7
  # elsewhere in the document.
8
8
  class ThreeDReference < Pdfrb::Model::Cos::Dictionary
9
+ arlington_object "3DReference"
9
10
  def type; self[:Type]; end
10
11
  def target_stream; self[:Target]; end
11
12
 
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # 3D Render Mode (s13.6.4, Table 318-319). Rendering style for
7
7
  # 3D objects (solid, wireframe, transparent, etc.).
8
8
  class ThreeDRenderMode < Pdfrb::Model::Cos::Dictionary
9
+ arlington_object "3DRenderMode"
9
10
  def type; self[:Type]; end
10
11
  def subtype; self[:Subtype]&.to_sym; end
11
12
  def auxiliary_color; self[:AC]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # 3D Stream (s13.6.3). Carries a U3D or PRC binary 3D model.
7
7
  class ThreeDStream < Pdfrb::Model::Cos::Stream
8
+ arlington_object "3DStream"
8
9
  def type; self[:Type]; end
9
10
  def subtype; self[:Subtype]&.to_sym; end
10
11
  def views; self[:VA]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # 3D Units (s13.6.4). Scaling factor and unit name for 3D measures.
7
7
  class ThreeDUnits < Pdfrb::Model::Cos::Dictionary
8
+ arlington_object "3DUnits"
8
9
  def type; self[:Type]; end
9
10
  def unit_name; self[:U]; end
10
11
  def scale_factor; self[:SF]; end
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # 3D View (s13.6.4). A single camera/lighting/material configuration
7
7
  # for a 3D stream.
8
8
  class ThreeDView < Pdfrb::Model::Cos::Dictionary
9
+ arlington_object "3DView"
9
10
  def type; self[:Type]; end
10
11
  def external_name; self[:XN]; end
11
12
  def internal_name; self[:IN]; end
@@ -5,6 +5,7 @@ module Pdfrb
5
5
  module Type
6
6
  # Underline annotation. /Subtype /Underline.
7
7
  class UnderlineAnnotation < TextMarkupAnnotation
8
+ arlington_object "AnnotUnderline"
8
9
  end
9
10
  end
10
11
  end
@@ -6,6 +6,7 @@ module Pdfrb
6
6
  # Watermark annotation (s12.5.6.23). PDF 2.0. Non-printing,
7
7
  # non-interactive visual watermark behind/over page content.
8
8
  class WatermarkAnnotation < Annotation
9
+ arlington_object "AnnotWatermark"
9
10
  def fixed_print?; !!value[:FixedPrint]; end
10
11
  end
11
12
  end
@@ -394,6 +394,13 @@ module Pdfrb
394
394
 
395
395
  # Sound action (s12.6.4.11, deprecated 2.0).
396
396
  autoload :ActionSound, "pdfrb/model/type/action_sound"
397
+
398
+ # Document Security Store (ETSI EN 319 142-1 PAdES).
399
+ autoload :Dss, "pdfrb/model/type/dss"
400
+
401
+ # Document Part hierarchy (ISO 16612-2 PDF/VT).
402
+ autoload :DPartRoot, "pdfrb/model/type/d_part"
403
+ autoload :DPart, "pdfrb/model/type/d_part"
397
404
  end
398
405
  end
399
406
  end
data/lib/pdfrb/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pdfrb
4
- VERSION = "0.7.18"
4
+ VERSION = "0.7.20"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdfrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.18
4
+ version: 0.7.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-08-16 00:00:00.000000000 Z
11
+ date: 2026-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -1004,11 +1004,13 @@ files:
1004
1004
  - lib/pdfrb/model/type/collection_schema.rb
1005
1005
  - lib/pdfrb/model/type/collection_sort.rb
1006
1006
  - lib/pdfrb/model/type/crypt_filter.rb
1007
+ - lib/pdfrb/model/type/d_part.rb
1007
1008
  - lib/pdfrb/model/type/device_n.rb
1008
1009
  - lib/pdfrb/model/type/device_n_mixing_hints.rb
1009
1010
  - lib/pdfrb/model/type/device_n_process.rb
1010
1011
  - lib/pdfrb/model/type/doc_mdp_transform_parameters.rb
1011
1012
  - lib/pdfrb/model/type/document_security_store.rb
1013
+ - lib/pdfrb/model/type/dss.rb
1012
1014
  - lib/pdfrb/model/type/embedded_file.rb
1013
1015
  - lib/pdfrb/model/type/embedded_file_parameter.rb
1014
1016
  - lib/pdfrb/model/type/encryption_public_key.rb