pdfrb 0.7.33 → 0.7.34
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 +4 -4
- data/lib/pdfrb/model/type/media_clip.rb +51 -0
- data/lib/pdfrb/model/type/media_offset.rb +37 -0
- data/lib/pdfrb/model/type/rendition.rb +34 -0
- data/lib/pdfrb/model/type.rb +13 -0
- data/lib/pdfrb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 63bc7a84b2c25516f6471a8ef25aa513cd952ba83ea17b7bc3dd2c73171da943
|
|
4
|
+
data.tar.gz: 8b0177a111dbdf1746f4ad128ec4c1a0fcd4d8d95ca74c8f429708f3c269290e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 631ee3dcb0e45ac7ac4801491ab40aed9e8aeaea85bdc966d11ab7f1f06f498654a395d7a1ddc40be63fd8dbf3338a1fe72a6eb27e47ebce1dc3cb132b0e6841
|
|
7
|
+
data.tar.gz: e744fa0dd1887afb443ba54f8605638a102c2f5e3e6174ab090bd6a31a970b0c07424d7ba3ce751c1f6a61b629df7f47a702152e767e7d08933e4dcff1e25140
|
|
@@ -5,6 +5,7 @@ module Pdfrb
|
|
|
5
5
|
module Type
|
|
6
6
|
# Media Clip Data stream (s13.3.3). Carries actual media payload.
|
|
7
7
|
class MediaClip < Pdfrb::Model::Cos::Stream
|
|
8
|
+
arlington_object "MediaClipData"
|
|
8
9
|
def type; self[:Type]; end
|
|
9
10
|
def subtype; self[:S]&.to_sym; end
|
|
10
11
|
|
|
@@ -23,6 +24,56 @@ module Pdfrb
|
|
|
23
24
|
document.object(ref)
|
|
24
25
|
end
|
|
25
26
|
end
|
|
27
|
+
|
|
28
|
+
# Media Clip Data MH/BE sub-dictionary (s13.3.3): /BU alternate
|
|
29
|
+
# file-by-URL used when the primary fails.
|
|
30
|
+
class MediaClipDataMHBE < Pdfrb::Model::Cos::Dictionary
|
|
31
|
+
arlington_object "MediaClipDataMHBE"
|
|
32
|
+
|
|
33
|
+
def alternate_url; self[:BU]; end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Media Clip Section stream (s13.3.4): a temporal sub-section
|
|
37
|
+
# of a MediaClipData.
|
|
38
|
+
class MediaClipSection < Pdfrb::Model::Cos::Stream
|
|
39
|
+
arlington_object "MediaClipSection"
|
|
40
|
+
|
|
41
|
+
def subtype; self[:S]&.to_sym; end
|
|
42
|
+
def name; self[:N]; end
|
|
43
|
+
def duration; self[:D]; end
|
|
44
|
+
def alternates; self[:Alt]; end
|
|
45
|
+
def must_honor; self[:MH]; end
|
|
46
|
+
def best_effort; self[:BE]; end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Section MH/BE sub-dictionary (s13.3.4): begin/end times.
|
|
50
|
+
class MediaClipSectionMHBE < Pdfrb::Model::Cos::Dictionary
|
|
51
|
+
arlington_object "MediaClipSectionMHBE"
|
|
52
|
+
|
|
53
|
+
def begin; self[:B]; end
|
|
54
|
+
def ends; self[:E]; end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Media duration (s13.3.2): /T time value in seconds.
|
|
58
|
+
class MediaDuration < Pdfrb::Model::Cos::Dictionary
|
|
59
|
+
arlington_object "MediaDuration"
|
|
60
|
+
|
|
61
|
+
def seconds; self[:T]; end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Media permissions (s13.3.2, Temp-File TF flags): validity
|
|
65
|
+
# after saving, printing, and extraction.
|
|
66
|
+
class MediaPermissions < Pdfrb::Model::Cos::Dictionary
|
|
67
|
+
arlington_object "MediaPermissions"
|
|
68
|
+
|
|
69
|
+
def temp_file_flags; self[:TF]; end
|
|
70
|
+
|
|
71
|
+
# Bit 1: media invalid after saving.
|
|
72
|
+
def invalid_after_save?; !temp_file_flags.nil? && temp_file_flags.nobits?(1); end
|
|
73
|
+
|
|
74
|
+
# Bit 2: media invalid after printing.
|
|
75
|
+
def invalid_after_print?; !temp_file_flags.nil? && temp_file_flags.nobits?(2); end
|
|
76
|
+
end
|
|
26
77
|
end
|
|
27
78
|
end
|
|
28
79
|
end
|
|
@@ -108,6 +108,43 @@ module Pdfrb
|
|
|
108
108
|
!!bit_rate
|
|
109
109
|
end
|
|
110
110
|
end
|
|
111
|
+
|
|
112
|
+
# Media play parameters (s13.3.2): controls for playing a
|
|
113
|
+
# rendition; /MH and /BE wrap the same set.
|
|
114
|
+
class MediaPlayParameters < Pdfrb::Model::Cos::Dictionary
|
|
115
|
+
arlington_object "MediaPlayParameters"
|
|
116
|
+
|
|
117
|
+
def players; self[:PL]; end
|
|
118
|
+
def must_honor; self[:MH]; end
|
|
119
|
+
def best_effort; self[:BE]; end
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Play parameter set for must-honor (s13.2.2): volume V,
|
|
123
|
+
# controls C, fit F, duration D, repeat count A, audio RC.
|
|
124
|
+
class MediaPlayParametersMH < Pdfrb::Model::Cos::Dictionary
|
|
125
|
+
arlington_object "MediaPlayParametersMH"
|
|
126
|
+
|
|
127
|
+
def volume; self[:V]; end
|
|
128
|
+
def fit; self[:F]; end
|
|
129
|
+
def duration; self[:D]; end
|
|
130
|
+
def repeat_count; self[:A]; end
|
|
131
|
+
def audio_rewrite; self[:RC]; end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Play parameter set for best-effort (s13.2.2).
|
|
135
|
+
class MediaPlayParametersBE < MediaPlayParametersMH
|
|
136
|
+
arlington_object "MediaPlayParametersBE"
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Screen parameter set for MH/BE (s13.2.2): window W,
|
|
140
|
+
# background color B, opacity O, duration M, floating F.
|
|
141
|
+
class MediaScreenParametersMHBE < Pdfrb::Model::Cos::Dictionary
|
|
142
|
+
arlington_object "MediaScreenParametersMHBE"
|
|
143
|
+
|
|
144
|
+
def window; self[:W]; end
|
|
145
|
+
def background_color; self[:B]; end
|
|
146
|
+
def opacity; self[:O]; end
|
|
147
|
+
end
|
|
111
148
|
end
|
|
112
149
|
end
|
|
113
150
|
end
|
|
@@ -26,6 +26,40 @@ module Pdfrb
|
|
|
26
26
|
document.object(ref)
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
|
+
|
|
30
|
+
# Media rendition /S /MR (s13.3.5): plays a media clip.
|
|
31
|
+
class RenditionMedia < Rendition
|
|
32
|
+
arlington_object "RenditionMedia"
|
|
33
|
+
|
|
34
|
+
def must_honor; self[:MH]; end
|
|
35
|
+
def best_effort; self[:BE]; end
|
|
36
|
+
def media_permissions; self[:P]; end
|
|
37
|
+
def visible_on_page?; self[:SP] != false; end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Selector rendition /S /SR (s13.3.5): picks among renditions.
|
|
41
|
+
class RenditionSelector < Rendition
|
|
42
|
+
arlington_object "RenditionSelector"
|
|
43
|
+
|
|
44
|
+
def must_honor; self[:MH]; end
|
|
45
|
+
def best_effort; self[:BE]; end
|
|
46
|
+
def renditions; self[:R]; end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Must-honor parameter wrapper {C: params} (s13.2.2): the
|
|
50
|
+
# conforming reader must satisfy these or abort.
|
|
51
|
+
class RenditionMH < Pdfrb::Model::Cos::Dictionary
|
|
52
|
+
arlington_object "RenditionMH"
|
|
53
|
+
|
|
54
|
+
def parameters; self[:C]; end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Best-effort parameter wrapper {C: params} (s13.2.2).
|
|
58
|
+
class RenditionBE < Pdfrb::Model::Cos::Dictionary
|
|
59
|
+
arlington_object "RenditionBE"
|
|
60
|
+
|
|
61
|
+
def parameters; self[:C]; end
|
|
62
|
+
end
|
|
29
63
|
end
|
|
30
64
|
end
|
|
31
65
|
end
|
data/lib/pdfrb/model/type.rb
CHANGED
|
@@ -311,6 +311,19 @@ module Pdfrb
|
|
|
311
311
|
autoload :AppearanceSubDict, "pdfrb/model/type/appearance_trap_net"
|
|
312
312
|
autoload :MediaClip, "pdfrb/model/type/media_clip"
|
|
313
313
|
autoload :Rendition, "pdfrb/model/type/rendition"
|
|
314
|
+
autoload :RenditionMedia, "pdfrb/model/type/rendition"
|
|
315
|
+
autoload :RenditionSelector, "pdfrb/model/type/rendition"
|
|
316
|
+
autoload :RenditionMH, "pdfrb/model/type/rendition"
|
|
317
|
+
autoload :RenditionBE, "pdfrb/model/type/rendition"
|
|
318
|
+
autoload :MediaClipDataMHBE, "pdfrb/model/type/media_clip"
|
|
319
|
+
autoload :MediaClipSection, "pdfrb/model/type/media_clip"
|
|
320
|
+
autoload :MediaClipSectionMHBE, "pdfrb/model/type/media_clip"
|
|
321
|
+
autoload :MediaDuration, "pdfrb/model/type/media_clip"
|
|
322
|
+
autoload :MediaPermissions, "pdfrb/model/type/media_clip"
|
|
323
|
+
autoload :MediaPlayParameters, "pdfrb/model/type/media_offset"
|
|
324
|
+
autoload :MediaPlayParametersMH, "pdfrb/model/type/media_offset"
|
|
325
|
+
autoload :MediaPlayParametersBE, "pdfrb/model/type/media_offset"
|
|
326
|
+
autoload :MediaScreenParametersMHBE, "pdfrb/model/type/media_offset"
|
|
314
327
|
autoload :ExDataProjection, "pdfrb/model/type/projection_annotation"
|
|
315
328
|
autoload :AnnotationProjectionDict, "pdfrb/model/type/projection_annotation"
|
|
316
329
|
|
data/lib/pdfrb/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.7.34
|
|
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-
|
|
11
|
+
date: 2026-08-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|