pdfrb 0.7.15 → 0.7.17

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0117148def4f7bc7280fa9727a6ce26fcafa9cb8f6e31cb32a480cb9548ac99e'
4
- data.tar.gz: a7bf629aabbef013625f56e4c719f97a4fa6bc2823c158d4d7f37ea9c6ff8379
3
+ metadata.gz: 67218c766df1cff2565d5020ad8089414e7892102117fc76a9413f0972c93648
4
+ data.tar.gz: 8be6840a038f7c132e10b549c3ed3f33180ea5b5b14bcc6804c01f322dac82cf
5
5
  SHA512:
6
- metadata.gz: f7d17104eaf145c31e843f94e622dd181b965f18aa4e3aba4adb80bedbdb500855984c603ef2ce60fa4abec31d1e4a07841d96397a71452147a6bff19c122b94
7
- data.tar.gz: e3513e197dff0e244f97adff17e332ff74b75509054449c32a779e8926bf1fbb91f9965b8a5757f78dbeb54f5e09741260b4139aef31f79cb0caaa25ca878b17
6
+ metadata.gz: a87239ec989b28f76e4c2f2a31e0efdc0b67a0dfb39030f51cc52b79343c2d5de42d40b7d4f816ef72ff930964b89c53f1aa4757f481eb6337f9283a4e6f5003
7
+ data.tar.gz: f4748a5236be87af4360070f8ae90f7a34a93ba1f782a347d772573118b6a63e7bb24c167220d4df8d69477c4014bfb90a32b39756dcd383cb90058a6cbb398a
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pdfrb
4
+ module Model
5
+ module Type
6
+ # Sound action (ISO 32000-2 §12.6.4.11, PDF 1.2, deprecated
7
+ # PDF 2.0). Plays a sound object.
8
+ class ActionSound < Pdfrb::Model::Cos::Dictionary
9
+ arlington_object "ActionSound"
10
+
11
+ # /Type — optional, fixed "Action".
12
+ def type
13
+ value[:Type]&.to_sym
14
+ end
15
+
16
+ # /S — required, fixed "Sound".
17
+ def action_type
18
+ value[:S]&.to_sym
19
+ end
20
+
21
+ # /Sound — required indirect stream with the sound data.
22
+ def sound(document = nil)
23
+ ref = value[:Sound]
24
+ return nil unless ref && document
25
+
26
+ ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
27
+ end
28
+
29
+ # /Volume — optional, -1.0 to 1.0 (default 1.0).
30
+ def volume
31
+ value[:Volume] || 1.0
32
+ end
33
+
34
+ # /Synchronous — optional, default false.
35
+ def synchronous?
36
+ value[:Synchronous] == true
37
+ end
38
+
39
+ # /Repeat — optional, default false.
40
+ def repeat?
41
+ value[:Repeat] == true
42
+ end
43
+
44
+ # /Mix — optional, default false. Whether to mix with
45
+ # existing sounds.
46
+ def mix?
47
+ value[:Mix] == true
48
+ end
49
+
50
+ # /Next — optional next action(s).
51
+ def next_action(document = nil)
52
+ ref = value[:Next]
53
+ return nil unless ref && document
54
+
55
+ ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pdfrb
4
+ module Model
5
+ module Type
6
+ # Additional Actions for the Catalog (ISO 32000-2 §12.6.3.17,
7
+ # PDF 1.4+). Referenced via /AA on the Catalog dict. Each entry
8
+ # is an indirect ECMAScript action triggered by the named
9
+ # document event.
10
+ class AddActionCatalog < Pdfrb::Model::Cos::Dictionary
11
+ arlington_object "AddActionCatalog"
12
+
13
+ # /DC — document close.
14
+ def document_close(document = nil)
15
+ resolve_action(:DC, document)
16
+ end
17
+
18
+ # /WS — will save.
19
+ def will_save(document = nil)
20
+ resolve_action(:WS, document)
21
+ end
22
+
23
+ # /DS — did save.
24
+ def did_save(document = nil)
25
+ resolve_action(:DS, document)
26
+ end
27
+
28
+ # /WP — will print.
29
+ def will_print(document = nil)
30
+ resolve_action(:WP, document)
31
+ end
32
+
33
+ # /DP — did print.
34
+ def did_print(document = nil)
35
+ resolve_action(:DP, document)
36
+ end
37
+
38
+ private
39
+
40
+ def resolve_action(key, document)
41
+ ref = value[key]
42
+ return nil unless ref && document
43
+
44
+ ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pdfrb
4
+ module Model
5
+ module Type
6
+ # AlternateImage (ISO 32000-2 §8.9.5, PDF 1.3+). An alternate
7
+ # image representation used when the primary image's color
8
+ # space isn't available (e.g. a DeviceGray fallback for a
9
+ # DeviceCMYK image on a monochrome printer).
10
+ class AlternateImage < Pdfrb::Model::Cos::Dictionary
11
+ arlington_object "AlternateImage"
12
+
13
+ # /Image — required indirect reference to the alternate
14
+ # image XObject.
15
+ def image(document = nil)
16
+ ref = value[:Image]
17
+ return nil unless ref && document
18
+
19
+ ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
20
+ end
21
+
22
+ # /DefaultForPrinting — optional, default false. When true,
23
+ # the alternate image is used for printing.
24
+ def default_for_printing?
25
+ value[:DefaultForPrinting] == true
26
+ end
27
+
28
+ # /OC — optional optional-content group controlling the
29
+ # alternate's visibility (PDF 1.5+).
30
+ def optional_content(document = nil)
31
+ ref = value[:OC]
32
+ return nil unless ref && document
33
+
34
+ ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pdfrb
4
+ module Model
5
+ module Type
6
+ # Bead (ISO 32000-2 §12.4.3, PDF 1.1+). A single rectangular
7
+ # portion of a page that is part of a Thread (article). Beads
8
+ # form a doubly-linked list via /N (next) and /V (previous).
9
+ class Bead < Pdfrb::Model::Cos::Dictionary
10
+ arlington_object "Bead"
11
+
12
+ # /Type — optional, fixed "Bead".
13
+ def type
14
+ value[:Type]&.to_sym
15
+ end
16
+
17
+ # /T — optional indirect Thread this bead belongs to.
18
+ def thread(document = nil)
19
+ ref = value[:T]
20
+ return nil unless ref && document
21
+
22
+ ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
23
+ end
24
+
25
+ # /N — required indirect next Bead.
26
+ def next_bead(document = nil)
27
+ ref = value[:N]
28
+ return nil unless ref && document
29
+
30
+ ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
31
+ end
32
+
33
+ # /V — required indirect previous Bead.
34
+ def previous_bead(document = nil)
35
+ ref = value[:V]
36
+ return nil unless ref && document
37
+
38
+ ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
39
+ end
40
+
41
+ # /P — required indirect Page the bead sits on.
42
+ def page(document = nil)
43
+ ref = value[:P]
44
+ return nil unless ref && document
45
+
46
+ ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
47
+ end
48
+
49
+ # /R — required rectangle on the page.
50
+ def rect
51
+ value[:R]
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pdfrb
4
+ module Model
5
+ module Type
6
+ # Thread (ISO 32000-2 §12.4.2, PDF 1.1+). Represents an
7
+ # article — a sequence of text blocks that flows across pages
8
+ # (e.g. a newspaper column that continues on a later page).
9
+ # Threads are listed in the Catalog's /Threads array.
10
+ class Thread < Pdfrb::Model::Cos::Dictionary
11
+ arlington_object "Thread"
12
+
13
+ # /Type — optional, fixed "Thread".
14
+ def type
15
+ value[:Type]&.to_sym
16
+ end
17
+
18
+ # /F — required indirect reference to the first Bead in
19
+ # the thread.
20
+ def first_bead(document = nil)
21
+ ref = value[:F]
22
+ return nil unless ref && document
23
+
24
+ ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
25
+ end
26
+
27
+ # /I — optional DocInfo dict with article metadata.
28
+ def info(document = nil)
29
+ ref = value[:I]
30
+ return nil unless ref && document
31
+
32
+ resolved = ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
33
+ return nil unless resolved
34
+
35
+ Pdfrb::Model::Type::Info.new(resolved.value) if resolved.value.is_a?(::Hash)
36
+ end
37
+
38
+ # /Metadata — optional indirect stream (PDF 2.0).
39
+ def metadata(document = nil)
40
+ ref = value[:Metadata]
41
+ return nil unless ref && document
42
+
43
+ ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pdfrb
4
+ module Model
5
+ module Type
6
+ # TrapRegion (Adobe TechNote 5620 §5.34, PDF 1.3, deprecated
7
+ # PDF 2.0). A trapping (prepress) region on a page. Referenced
8
+ # from /Annots as /Subtype /Traps or from separation profiles.
9
+ class TrapRegion < Pdfrb::Model::Cos::Dictionary
10
+ arlington_object "TrapRegion"
11
+
12
+ # /TP — required name: trapping parameters version.
13
+ def trap_parameters
14
+ value[:TP]
15
+ end
16
+
17
+ # /TZ — optional array-of-arrays of numbers defining trap
18
+ # zones.
19
+ def trap_zones
20
+ value[:TZ]
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pdfrb
4
+ module Model
5
+ module Type
6
+ # WebCaptureCommand (ISO 32000-1 §14.10.4, PDF 1.3, deprecated
7
+ # PDF 2.0). Describes a URL retrieval for the Web Capture
8
+ # (spider) system: what to fetch, how to fetch it, and what
9
+ # form data to post.
10
+ class WebCaptureCommand < Pdfrb::Model::Cos::Dictionary
11
+ arlington_object "WebCaptureCommand"
12
+
13
+ # /URL — required ASCII string to retrieve.
14
+ def url
15
+ value[:URL]
16
+ end
17
+
18
+ # /L — optional integer, delay before retrieval in seconds
19
+ # (default 1). Must be >= 1.
20
+ def delay_seconds
21
+ value[:L] || 1
22
+ end
23
+
24
+ # /F — optional bitmask of flags.
25
+ def flags
26
+ value[:F] || 0
27
+ end
28
+
29
+ # /CT — optional content type of posted data (RFC 2045).
30
+ def content_type
31
+ value[:CT] || "application/x-www-form-urlencoded"
32
+ end
33
+
34
+ # /S — optional WebCaptureCommandSettings dict.
35
+ def settings(document = nil)
36
+ ref = value[:S]
37
+ return nil unless ref && document
38
+
39
+ resolved = ref.is_a?(Pdfrb::Model::Reference) ? document.object(ref) : ref
40
+ return nil unless resolved
41
+
42
+ Pdfrb::Model::Type::WebCaptureCommandSettings.new(resolved.value)
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pdfrb
4
+ module Model
5
+ module Type
6
+ # WebCaptureCommandSettings (ISO 32000-1 §14.10.4, PDF 1.3,
7
+ # deprecated PDF 2.0). Browser-like settings (get/post data,
8
+ # cookies) for a WebCaptureCommand.
9
+ class WebCaptureCommandSettings < Pdfrb::Model::Cos::Dictionary
10
+ arlington_object "WebCaptureCommandSettings"
11
+
12
+ # /G — optional GET parameters dictionary.
13
+ def get_params
14
+ value[:G]
15
+ end
16
+
17
+ # /C — optional cookie parameters dictionary.
18
+ def cookie_params
19
+ value[:C]
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pdfrb
4
+ module Model
5
+ module Type
6
+ # WebCaptureImageSet (ISO 32000-1 §14.10.3, PDF 1.3, deprecated
7
+ # PDF 2.0). A spider content set holding captured images. The
8
+ # /O array lists image XObjects; /R gives the crawl depth for
9
+ # each image.
10
+ class WebCaptureImageSet < Pdfrb::Model::Cos::Stream
11
+ arlington_object "WebCaptureImageSet"
12
+
13
+ # /Type — optional, fixed "SpiderContentSet".
14
+ def type
15
+ value[:Type]&.to_sym
16
+ end
17
+
18
+ # /S — required, fixed "SIS" (Spider Image Set).
19
+ def set_type
20
+ value[:S]&.to_sym
21
+ end
22
+
23
+ # /ID — required unique identifier.
24
+ def set_id
25
+ value[:ID]
26
+ end
27
+
28
+ # /O — required array of indirect references to images.
29
+ def images(document = nil)
30
+ refs = value[:O]
31
+ return [] unless refs && document
32
+
33
+ arr = refs.is_a?(Pdfrb::Model::PdfArray) ? refs.value : refs
34
+ arr = [arr] unless arr.is_a?(::Array)
35
+ arr.filter_map { |r| r.is_a?(Pdfrb::Model::Reference) ? document.object(r) : r }
36
+ end
37
+
38
+ # /CT — optional content type (RFC 2045).
39
+ def content_type
40
+ value[:CT]
41
+ end
42
+
43
+ # /TS — optional date of capture.
44
+ def timestamp
45
+ value[:TS]
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pdfrb
4
+ module Model
5
+ module Type
6
+ # WebCapturePageSet (ISO 32000-1 §14.10.3, PDF 1.3, deprecated
7
+ # PDF 2.0). A spider content set holding captured pages. The
8
+ # /O array lists page objects converted from HTML.
9
+ class WebCapturePageSet < Pdfrb::Model::Cos::Stream
10
+ arlington_object "WebCapturePageSet"
11
+
12
+ # /Type — optional, fixed "SpiderContentSet".
13
+ def type
14
+ value[:Type]&.to_sym
15
+ end
16
+
17
+ # /S — required, fixed "SPS" (Spider Page Set).
18
+ def set_type
19
+ value[:S]&.to_sym
20
+ end
21
+
22
+ # /ID — required unique identifier.
23
+ def set_id
24
+ value[:ID]
25
+ end
26
+
27
+ # /O — required array of indirect references to pages.
28
+ def pages(document = nil)
29
+ refs = value[:O]
30
+ return [] unless refs && document
31
+
32
+ arr = refs.is_a?(Pdfrb::Model::PdfArray) ? refs.value : refs
33
+ arr = [arr] unless arr.is_a?(::Array)
34
+ arr.filter_map { |r| r.is_a?(Pdfrb::Model::Reference) ? document.object(r) : r }
35
+ end
36
+
37
+ # /CT — optional content type.
38
+ def content_type
39
+ value[:CT]
40
+ end
41
+
42
+ # /TS — optional date of capture.
43
+ def timestamp
44
+ value[:TS]
45
+ end
46
+ end
47
+
48
+ # WebCaptureInfo (ISO 32000-1 §14.10.2, PDF 1.3, deprecated
49
+ # PDF 2.0). Root dictionary for the Web Capture system, listed
50
+ # in the Catalog's /SpiderInfo key.
51
+ class WebCaptureInfo < Pdfrb::Model::Cos::Dictionary
52
+ arlington_object "WebCaptureInfo"
53
+
54
+ # /V — required version number (fixed 1).
55
+ def version
56
+ value[:V]
57
+ end
58
+
59
+ # /C — optional array of WebCaptureCommands.
60
+ def commands(document = nil)
61
+ refs = value[:C]
62
+ return [] unless refs && document
63
+
64
+ arr = refs.is_a?(Pdfrb::Model::PdfArray) ? refs.value : refs
65
+ arr = [arr] unless arr.is_a?(::Array)
66
+ arr.filter_map do |r|
67
+ resolved = r.is_a?(Pdfrb::Model::Reference) ? document.object(r) : r
68
+ next nil unless resolved && resolved.value.is_a?(::Hash)
69
+
70
+ Pdfrb::Model::Type::WebCaptureCommand.new(resolved.value)
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
@@ -371,6 +371,29 @@ module Pdfrb
371
371
 
372
372
  # User property (s14.7.5).
373
373
  autoload :UserProperty, "pdfrb/model/type/user_property"
374
+
375
+ # Threads/articles (s12.4).
376
+ autoload :Thread, "pdfrb/model/type/thread"
377
+ autoload :Bead, "pdfrb/model/type/bead"
378
+
379
+ # Web Capture / spider (s14.10, PDF 1.3, deprecated 2.0).
380
+ autoload :WebCaptureInfo, "pdfrb/model/type/web_capture_page_set"
381
+ autoload :WebCaptureCommand, "pdfrb/model/type/web_capture_command"
382
+ autoload :WebCaptureCommandSettings, "pdfrb/model/type/web_capture_command_settings"
383
+ autoload :WebCaptureImageSet, "pdfrb/model/type/web_capture_image_set"
384
+ autoload :WebCapturePageSet, "pdfrb/model/type/web_capture_page_set"
385
+
386
+ # Trapping (Adobe TechNote 5620).
387
+ autoload :TrapRegion, "pdfrb/model/type/trap_region"
388
+
389
+ # Additional actions on the Catalog (s12.6.3.17).
390
+ autoload :AddActionCatalog, "pdfrb/model/type/add_action_catalog"
391
+
392
+ # Alternate image (s8.9.5).
393
+ autoload :AlternateImage, "pdfrb/model/type/alternate_image"
394
+
395
+ # Sound action (s12.6.4.11, deprecated 2.0).
396
+ autoload :ActionSound, "pdfrb/model/type/action_sound"
374
397
  end
375
398
  end
376
399
  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.15"
4
+ VERSION = "0.7.17"
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.15
4
+ version: 0.7.17
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-14 00:00:00.000000000 Z
11
+ date: 2026-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -968,18 +968,22 @@ files:
968
968
  - lib/pdfrb/model/type/action_rich_media_execute.rb
969
969
  - lib/pdfrb/model/type/action_set_ocg_state.rb
970
970
  - lib/pdfrb/model/type/action_set_state.rb
971
+ - lib/pdfrb/model/type/action_sound.rb
971
972
  - lib/pdfrb/model/type/action_sound_action.rb
972
973
  - lib/pdfrb/model/type/action_submit_form.rb
973
974
  - lib/pdfrb/model/type/action_thread.rb
974
975
  - lib/pdfrb/model/type/action_trans.rb
975
976
  - lib/pdfrb/model/type/action_uri.rb
977
+ - lib/pdfrb/model/type/add_action_catalog.rb
976
978
  - lib/pdfrb/model/type/af_embedded_file.rb
977
979
  - lib/pdfrb/model/type/af_file_specification.rb
980
+ - lib/pdfrb/model/type/alternate_image.rb
978
981
  - lib/pdfrb/model/type/annotation.rb
979
982
  - lib/pdfrb/model/type/appearance.rb
980
983
  - lib/pdfrb/model/type/appearance_characteristics.rb
981
984
  - lib/pdfrb/model/type/appearance_generator.rb
982
985
  - lib/pdfrb/model/type/appearance_trap_net.rb
986
+ - lib/pdfrb/model/type/bead.rb
983
987
  - lib/pdfrb/model/type/border_effect.rb
984
988
  - lib/pdfrb/model/type/border_styling.rb
985
989
  - lib/pdfrb/model/type/box_color_info.rb
@@ -1133,6 +1137,7 @@ files:
1133
1137
  - lib/pdfrb/model/type/text_appearance.rb
1134
1138
  - lib/pdfrb/model/type/text_field.rb
1135
1139
  - lib/pdfrb/model/type/text_markup_annotation.rb
1140
+ - lib/pdfrb/model/type/thread.rb
1136
1141
  - lib/pdfrb/model/type/three_d_activation.rb
1137
1142
  - lib/pdfrb/model/type/three_d_animation_style.rb
1138
1143
  - lib/pdfrb/model/type/three_d_background.rb
@@ -1154,6 +1159,7 @@ files:
1154
1159
  - lib/pdfrb/model/type/timespan.rb
1155
1160
  - lib/pdfrb/model/type/to_unicode_cmap_stream.rb
1156
1161
  - lib/pdfrb/model/type/transition.rb
1162
+ - lib/pdfrb/model/type/trap_region.rb
1157
1163
  - lib/pdfrb/model/type/underline_annotation.rb
1158
1164
  - lib/pdfrb/model/type/ur_transform_parameters.rb
1159
1165
  - lib/pdfrb/model/type/uri_dict.rb
@@ -1164,6 +1170,10 @@ files:
1164
1170
  - lib/pdfrb/model/type/viewport.rb
1165
1171
  - lib/pdfrb/model/type/vri.rb
1166
1172
  - lib/pdfrb/model/type/watermark_annotation.rb
1173
+ - lib/pdfrb/model/type/web_capture_command.rb
1174
+ - lib/pdfrb/model/type/web_capture_command_settings.rb
1175
+ - lib/pdfrb/model/type/web_capture_image_set.rb
1176
+ - lib/pdfrb/model/type/web_capture_page_set.rb
1167
1177
  - lib/pdfrb/model/type/widget_annotation.rb
1168
1178
  - lib/pdfrb/model/type/widget_appearance.rb
1169
1179
  - lib/pdfrb/model/type/xobject_form.rb