pdfrb 0.7.27 → 0.7.29
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/cid_font_descriptor_metrics.rb +1 -0
- data/lib/pdfrb/model/type/doc_mdp_transform_parameters.rb +1 -0
- data/lib/pdfrb/model/type/field_mdp_transform_parameters.rb +1 -0
- data/lib/pdfrb/model/type/font_cid_type0.rb +1 -0
- data/lib/pdfrb/model/type/font_cid_type2.rb +1 -0
- data/lib/pdfrb/model/type/font_descriptor_cid_type0.rb +1 -0
- data/lib/pdfrb/model/type/font_descriptor_cid_type2.rb +1 -0
- data/lib/pdfrb/model/type/font_encoding.rb +1 -0
- data/lib/pdfrb/model/type/font_file.rb +1 -0
- data/lib/pdfrb/model/type/font_file2.rb +1 -0
- data/lib/pdfrb/model/type/font_multiple_master.rb +2 -0
- data/lib/pdfrb/model/type/mdp_dict.rb +1 -0
- data/lib/pdfrb/model/type/opt_content_ext.rb +22 -0
- data/lib/pdfrb/model/type/opt_content_page_element.rb +1 -0
- data/lib/pdfrb/model/type/optional_content_config.rb +1 -0
- data/lib/pdfrb/model/type/pattern.rb +25 -0
- data/lib/pdfrb/model/type/pattern_shading.rb +1 -0
- data/lib/pdfrb/model/type/pattern_tiling.rb +1 -0
- data/lib/pdfrb/model/type/shading.rb +141 -0
- data/lib/pdfrb/model/type/sig_field_lock.rb +1 -0
- data/lib/pdfrb/model/type/sig_field_seed_value.rb +1 -0
- data/lib/pdfrb/model/type/signature.rb +4 -1
- data/lib/pdfrb/model/type/signature_build.rb +7 -0
- data/lib/pdfrb/model/type/to_unicode_cmap_stream.rb +1 -0
- data/lib/pdfrb/model/type.rb +15 -0
- data/lib/pdfrb/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6a8b1b706618c7a1e4ceb7373b2c9a2ca0ec84391aa8570476f4fdec96e955ef
|
|
4
|
+
data.tar.gz: 4b4be07bc31d2e21de54a3458caf558878b8648961f514d6e7fc2ea19c82b4c9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d18f1ccadfcdce61fb0568ee158f4037a1c693e5706134c4766976ab77a7e3ec16d8acb2ae1f08f9bf02d20e604fe24e0416c481dc67745c6f4a8a2a7c8f5333
|
|
7
|
+
data.tar.gz: c1104b11eb1cd74cc5cc82b213bed68c15a1a750581a569836581e79e1aa28c83532d154df67de3c735049df3b88a55a10f70e6ba52af39d869aa5a141f8ef14
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# CID Font Descriptor Metrics (s9.8.1, Table 117). Per-CIDFont
|
|
7
7
|
# metrics used for embedded CIDFontType0/CIDFontType2.
|
|
8
8
|
class CIDFontDescriptorMetrics < Pdfrb::Model::Cos::Dictionary
|
|
9
|
+
arlington_object "CIDFontDescriptorMetrics"
|
|
9
10
|
def style; self[:Style]&.to_sym; end
|
|
10
11
|
def cid_set; self[:CIDSet]; end
|
|
11
12
|
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# Document Modification Detection and Prevention (DocMDP) —
|
|
7
7
|
# s12.8.2.2. Restricts what edits are allowed after signing.
|
|
8
8
|
class DocMDPTransformParameters < Pdfrb::Model::Cos::Dictionary
|
|
9
|
+
arlington_object "DocMDPTransformParameters"
|
|
9
10
|
def type; self[:Type]; end
|
|
10
11
|
def p; self[:P]; end
|
|
11
12
|
def v; self[:V]; end
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# Field MDP Transform Parameters (s12.7.6.5). Specifies which
|
|
7
7
|
# fields are locked by a FieldMDP signature reference.
|
|
8
8
|
class FieldMDPTransformParameters < Pdfrb::Model::Cos::Dictionary
|
|
9
|
+
arlington_object "FieldMDPTransformParameters"
|
|
9
10
|
def type; self[:Type]; end
|
|
10
11
|
def action; self[:Action]&.to_sym; end
|
|
11
12
|
def fields; self[:Fields]; end
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# Font Descriptor CIDType2 (s9.8). Specialised metrics for
|
|
7
7
|
# CIDFontType2 (TrueType-based CID fonts).
|
|
8
8
|
class FontDescriptorCIDType2 < FontDescriptor
|
|
9
|
+
arlington_object "FontDescriptorCIDType2"
|
|
9
10
|
def cid_font_type; 2; end
|
|
10
11
|
|
|
11
12
|
def true_type?; true; end
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# Font Encoding dict (s9.6.1). Base encoding + per-glyph differences
|
|
7
7
|
# table for Type 1 fonts.
|
|
8
8
|
class FontEncoding < Pdfrb::Model::Cos::Dictionary
|
|
9
|
+
arlington_object "Encoding"
|
|
9
10
|
def base_encoding; self[:BaseEncoding]&.to_sym; end
|
|
10
11
|
def differences; self[:Differences]; end
|
|
11
12
|
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# Type 1 font file stream (s7.8.2). Holds the Type1 / Type1C
|
|
7
7
|
# font program. Referenced by FontDescriptor /FontFile.
|
|
8
8
|
class FontFile < Pdfrb::Model::Cos::Stream
|
|
9
|
+
arlington_object "FontFile"
|
|
9
10
|
def length1; self[:Length1]; end
|
|
10
11
|
def length2; self[:Length2]; end
|
|
11
12
|
def length3; self[:Length3]; end
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# TrueType font file stream (s7.8.3). Holds the TTF/OTF program.
|
|
7
7
|
# Referenced by FontDescriptor /FontFile2.
|
|
8
8
|
class FontFile2 < Pdfrb::Model::Cos::Stream
|
|
9
|
+
arlington_object "FontFile2"
|
|
9
10
|
def length1; self[:Length1]; end
|
|
10
11
|
def subtype; self[:Subtype]; end
|
|
11
12
|
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# MultipleMaster Type 1 font (s9.6.2.3). Type 1 font with
|
|
7
7
|
# additional design axes between masters. Deprecated in PDF 2.0.
|
|
8
8
|
class FontMultipleMaster < Font
|
|
9
|
+
arlington_object "FontMultipleMaster"
|
|
9
10
|
def subtype; self[:Subtype]&.to_sym; end
|
|
10
11
|
def name; self[:Name]; end
|
|
11
12
|
def first_char; self[:FirstChar]; end
|
|
@@ -37,6 +38,7 @@ module Pdfrb
|
|
|
37
38
|
# The actual procedures live as streams under their names in a
|
|
38
39
|
# Tiling pattern's Resources.
|
|
39
40
|
class CharProcMap < Pdfrb::Model::Cos::Dictionary
|
|
41
|
+
arlington_object "CharProcMap"
|
|
40
42
|
def entries
|
|
41
43
|
value.each
|
|
42
44
|
end
|
|
@@ -7,6 +7,7 @@ module Pdfrb
|
|
|
7
7
|
# The /Reference entry on a Signature, with /TransformMethod /DocMDP
|
|
8
8
|
# or /UR (Usage Rights).
|
|
9
9
|
class MDPDict < Pdfrb::Model::Cos::Dictionary
|
|
10
|
+
arlington_object "MDPDict"
|
|
10
11
|
def type; self[:Type]; end
|
|
11
12
|
def transform_method; self[:TransformMethod]&.to_sym; end
|
|
12
13
|
def transform_params; self[:TransformParams]; end
|
|
@@ -7,6 +7,7 @@ module Pdfrb
|
|
|
7
7
|
# which OCGs to enable when the user views/prints/exports the
|
|
8
8
|
# document.
|
|
9
9
|
class OptContentUsageApplication < Pdfrb::Model::Cos::Dictionary
|
|
10
|
+
arlington_object "OptContentUsageApplication"
|
|
10
11
|
def event; self[:Event]&.to_sym; end
|
|
11
12
|
def ocgs; self[:OCGs]; end
|
|
12
13
|
def category; self[:Category]; end
|
|
@@ -30,6 +31,7 @@ module Pdfrb
|
|
|
30
31
|
# Optional Content Creator Info dict (s8.11.2.2). Attribution
|
|
31
32
|
# for who created a layer.
|
|
32
33
|
class OptContentCreatorInfo < Pdfrb::Model::Cos::Dictionary
|
|
34
|
+
arlington_object "OptContentCreatorInfo"
|
|
33
35
|
def creator; self[:Creator]; end
|
|
34
36
|
def subtitle; self[:Subtitle]; end
|
|
35
37
|
def creator_app_version; self[:CreatorAppVersion]; end
|
|
@@ -42,6 +44,7 @@ module Pdfrb
|
|
|
42
44
|
# Optional Content Export dict (s8.11.2.3). Specific OCG toggle
|
|
43
45
|
# for the export workflow.
|
|
44
46
|
class OptContentExport < Pdfrb::Model::Cos::Dictionary
|
|
47
|
+
arlington_object "OptContentExport"
|
|
45
48
|
def export_ocgs; self[:ExportOCGs]; end
|
|
46
49
|
def intent; self[:Intent]&.to_sym; end
|
|
47
50
|
|
|
@@ -57,6 +60,7 @@ module Pdfrb
|
|
|
57
60
|
# Optional Content Print dict (s8.11.2.4). Similar to Export but
|
|
58
61
|
# for the printing workflow.
|
|
59
62
|
class OptContentPrint < Pdfrb::Model::Cos::Dictionary
|
|
63
|
+
arlington_object "OptContentPrint"
|
|
60
64
|
def print_ocgs; self[:PrintOCGs]; end
|
|
61
65
|
def print_state; self[:PrintState]&.to_sym; end
|
|
62
66
|
|
|
@@ -67,6 +71,7 @@ module Pdfrb
|
|
|
67
71
|
|
|
68
72
|
# Optional Content View dict (s8.11.2.5). Per-view OCG visibility.
|
|
69
73
|
class OptContentView < Pdfrb::Model::Cos::Dictionary
|
|
74
|
+
arlington_object "OptContentView"
|
|
70
75
|
def view_name; self[:Name]; end
|
|
71
76
|
def view_state_name; self[:ViewState]; end
|
|
72
77
|
end
|
|
@@ -74,6 +79,7 @@ module Pdfrb
|
|
|
74
79
|
# Optional Content Language dict (s8.11.2.6). Maps OCG to natural
|
|
75
80
|
# language for preference-based visibility.
|
|
76
81
|
class OptContentLanguage < Pdfrb::Model::Cos::Dictionary
|
|
82
|
+
arlington_object "OptContentLanguage"
|
|
77
83
|
def language_string; self[:Lang]; end
|
|
78
84
|
def ocgs; self[:OCGs]; end
|
|
79
85
|
def preferred; self[:Preferred] || 0; end
|
|
@@ -89,6 +95,22 @@ module Pdfrb
|
|
|
89
95
|
end
|
|
90
96
|
end
|
|
91
97
|
end
|
|
98
|
+
|
|
99
|
+
# /Usage /User entry (s8.11.4.4). Intended consumer of the
|
|
100
|
+
# group.
|
|
101
|
+
class OptContentUser < Pdfrb::Model::Cos::Dictionary
|
|
102
|
+
arlington_object "OptContentUser"
|
|
103
|
+
|
|
104
|
+
def name; self[:Name]; end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# /Usage /Zoom entry (s8.11.4.4). Zoom-range visibility.
|
|
108
|
+
class OptContentZoom < Pdfrb::Model::Cos::Dictionary
|
|
109
|
+
arlington_object "OptContentZoom"
|
|
110
|
+
|
|
111
|
+
def min; self[:min]; end
|
|
112
|
+
def max; self[:max]; end
|
|
113
|
+
end
|
|
92
114
|
end
|
|
93
115
|
end
|
|
94
116
|
end
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# Opt Content Page Element (s8.11). Marks page elements for
|
|
7
7
|
# automatic optional-content group creation.
|
|
8
8
|
class OptContentPageElement < Pdfrb::Model::Cos::Dictionary
|
|
9
|
+
arlington_object "OptContentPageElement"
|
|
9
10
|
def subtype; self[:Subtype]&.to_sym; end
|
|
10
11
|
def ocgs; self[:OCGs]; end
|
|
11
12
|
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# Optional Content Configuration (s8.11.4.1). Per-view configuration
|
|
7
7
|
# of OCG visibility, intent, and locking.
|
|
8
8
|
class OptionalContentConfiguration < Cos::Dictionary
|
|
9
|
+
arlington_object "OptContentConfig"
|
|
9
10
|
register_type :OCConfig
|
|
10
11
|
|
|
11
12
|
def type; self[:Type]; end
|
|
@@ -11,6 +11,31 @@ module Pdfrb
|
|
|
11
11
|
def tiling?; pattern_type == 1; end
|
|
12
12
|
def shading?; pattern_type == 2; end
|
|
13
13
|
end
|
|
14
|
+
|
|
15
|
+
# Resources /Pattern dictionary (s7.8.5). Maps resource names
|
|
16
|
+
# to patterns.
|
|
17
|
+
class PatternMap < Pdfrb::Model::Cos::Dictionary
|
|
18
|
+
arlington_object "PatternMap"
|
|
19
|
+
|
|
20
|
+
def [](name)
|
|
21
|
+
value[name.to_sym] || value[name.to_s]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def add(name, pattern)
|
|
25
|
+
value[name.to_sym] = pattern
|
|
26
|
+
name.to_sym
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def each_pattern(&)
|
|
30
|
+
return enum_for(:each_pattern) unless block_given?
|
|
31
|
+
|
|
32
|
+
value.each(&)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def names
|
|
36
|
+
value.keys
|
|
37
|
+
end
|
|
38
|
+
end
|
|
14
39
|
end
|
|
15
40
|
end
|
|
16
41
|
end
|
|
@@ -5,6 +5,7 @@ module Pdfrb
|
|
|
5
5
|
module Type
|
|
6
6
|
# Type 2 shading pattern (s8.7.4.1). Fills with a Shading dict.
|
|
7
7
|
class PatternShading < Pattern
|
|
8
|
+
arlington_object "PatternType2"
|
|
8
9
|
def shading; self[:Shading]; end
|
|
9
10
|
def matrix; self[:Matrix]; end
|
|
10
11
|
def ext_g_state; self[:ExtGState]; end
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pdfrb
|
|
4
|
+
module Model
|
|
5
|
+
module Type
|
|
6
|
+
# Common keys and type predicates shared by dict-based and
|
|
7
|
+
# stream-based shadings (s8.7.4.1).
|
|
8
|
+
module ShadingCommon
|
|
9
|
+
def shading_type; self[:ShadingType]; end
|
|
10
|
+
def color_space; self[:ColorSpace]; end
|
|
11
|
+
def background; self[:Background]; end
|
|
12
|
+
def bbox; self[:BBox]; end
|
|
13
|
+
def anti_alias?; self[:AntiAlias] == true; end
|
|
14
|
+
def domain; self[:Domain]; end
|
|
15
|
+
def function; self[:Function]; end
|
|
16
|
+
|
|
17
|
+
def function_based?; shading_type == 1; end
|
|
18
|
+
def axial?; shading_type == 2; end
|
|
19
|
+
def radial?; shading_type == 3; end
|
|
20
|
+
def free_form_gouraud?; shading_type == 4; end
|
|
21
|
+
def lattice_gouraud?; shading_type == 5; end
|
|
22
|
+
def coons_patch?; shading_type == 6; end
|
|
23
|
+
def tensor_patch?; shading_type == 7; end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
class Shading < Pdfrb::Model::Cos::Dictionary
|
|
27
|
+
include ShadingCommon
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Type 1 — function-based shading (s8.7.4.2).
|
|
31
|
+
class ShadingType1 < Shading
|
|
32
|
+
arlington_object "ShadingType1"
|
|
33
|
+
|
|
34
|
+
def matrix; self[:Matrix]; end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Type 2 — axial shading (s8.7.4.3).
|
|
38
|
+
class ShadingType2 < Shading
|
|
39
|
+
arlington_object "ShadingType2"
|
|
40
|
+
|
|
41
|
+
def coords; self[:Coords]; end
|
|
42
|
+
def extend; self[:Extend]; end
|
|
43
|
+
|
|
44
|
+
def x0; coords && coords[0]; end
|
|
45
|
+
def x1; coords && coords[2]; end
|
|
46
|
+
def y0; coords && coords[1]; end
|
|
47
|
+
def y1; coords && coords[3]; end
|
|
48
|
+
|
|
49
|
+
def extends_start?; extend && extend[0] == true; end
|
|
50
|
+
def extends_end?; extend && extend[1] == true; end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Type 3 — radial shading (s8.7.4.4).
|
|
54
|
+
class ShadingType3 < Shading
|
|
55
|
+
arlington_object "ShadingType3"
|
|
56
|
+
|
|
57
|
+
def coords; self[:Coords]; end
|
|
58
|
+
def extend; self[:Extend]; end
|
|
59
|
+
|
|
60
|
+
# [x0 y0 r0 x1 y1 r1].
|
|
61
|
+
def r0; coords && coords[2]; end
|
|
62
|
+
def r1; coords && coords[5]; end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Type 4 — free-form Gouraud-shaded triangle mesh
|
|
66
|
+
# (s8.7.4.6.3). Stream carrying vertex data.
|
|
67
|
+
class ShadingType4 < Pdfrb::Model::Cos::Stream
|
|
68
|
+
include ShadingCommon
|
|
69
|
+
|
|
70
|
+
arlington_object "ShadingType4"
|
|
71
|
+
|
|
72
|
+
def bits_per_coordinate; self[:BitsPerCoordinate]; end
|
|
73
|
+
def bits_per_component; self[:BitsPerComponent]; end
|
|
74
|
+
def bits_per_flag; self[:BitsPerFlag]; end
|
|
75
|
+
def decode; self[:Decode]; end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Type 5 — lattice Gouraud-shaded triangle mesh
|
|
79
|
+
# (s8.7.4.6.4).
|
|
80
|
+
class ShadingType5 < Pdfrb::Model::Cos::Stream
|
|
81
|
+
include ShadingCommon
|
|
82
|
+
|
|
83
|
+
arlington_object "ShadingType5"
|
|
84
|
+
|
|
85
|
+
def bits_per_coordinate; self[:BitsPerCoordinate]; end
|
|
86
|
+
def bits_per_component; self[:BitsPerComponent]; end
|
|
87
|
+
def vertices_per_row; self[:VerticesPerRow]; end
|
|
88
|
+
def decode; self[:Decode]; end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Type 6 — Coons patch mesh (s8.7.4.7.4).
|
|
92
|
+
class ShadingType6 < Pdfrb::Model::Cos::Stream
|
|
93
|
+
include ShadingCommon
|
|
94
|
+
|
|
95
|
+
arlington_object "ShadingType6"
|
|
96
|
+
|
|
97
|
+
def bits_per_coordinate; self[:BitsPerCoordinate]; end
|
|
98
|
+
def bits_per_component; self[:BitsPerComponent]; end
|
|
99
|
+
def bits_per_flag; self[:BitsPerFlag]; end
|
|
100
|
+
def decode; self[:Decode]; end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Type 7 — tensor-product patch mesh (s8.7.4.7.5).
|
|
104
|
+
class ShadingType7 < Pdfrb::Model::Cos::Stream
|
|
105
|
+
include ShadingCommon
|
|
106
|
+
|
|
107
|
+
arlington_object "ShadingType7"
|
|
108
|
+
|
|
109
|
+
def bits_per_coordinate; self[:BitsPerCoordinate]; end
|
|
110
|
+
def bits_per_component; self[:BitsPerComponent]; end
|
|
111
|
+
def bits_per_flag; self[:BitsPerFlag]; end
|
|
112
|
+
def decode; self[:Decode]; end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Resources /Shading dictionary (s7.8.4). Maps resource names
|
|
116
|
+
# to shadings.
|
|
117
|
+
class ShadingMap < Pdfrb::Model::Cos::Dictionary
|
|
118
|
+
arlington_object "ShadingMap"
|
|
119
|
+
|
|
120
|
+
def [](name)
|
|
121
|
+
value[name.to_sym] || value[name.to_s]
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def add(name, shading)
|
|
125
|
+
value[name.to_sym] = shading
|
|
126
|
+
name.to_sym
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
def each_shading(&)
|
|
130
|
+
return enum_for(:each_shading) unless block_given?
|
|
131
|
+
|
|
132
|
+
value.each(&)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def names
|
|
136
|
+
value.keys
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
end
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# Signature field lock (s12.7.6.5). Specifies which fields are
|
|
7
7
|
# locked after signing.
|
|
8
8
|
class SigFieldLock < Pdfrb::Model::Cos::Dictionary
|
|
9
|
+
arlington_object "SigFieldLock"
|
|
9
10
|
def action; self[:Action]&.to_sym; end
|
|
10
11
|
def fields; self[:Fields]; end
|
|
11
12
|
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# Signature field seed value (s12.7.6.6). Constraints the signer
|
|
7
7
|
# must obey when signing (cert issuers, hash algorithms, etc.).
|
|
8
8
|
class SigFieldSeedValue < Pdfrb::Model::Cos::Dictionary
|
|
9
|
+
arlington_object "SigFieldSeedValue"
|
|
9
10
|
def filter; self[:Filter]; end
|
|
10
11
|
def sub_filter; self[:SubFilter]; end
|
|
11
12
|
def digest_method; self[:DigestMethod]; end
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# Signature dictionary (s12.8.2). Carries the PKCS#7 / CMS
|
|
7
7
|
# signature payload. Lives in a Signature field's /V entry.
|
|
8
8
|
class Signature < Pdfrb::Model::Cos::Dictionary
|
|
9
|
+
arlington_object "Signature"
|
|
9
10
|
def type; self[:Type]; end
|
|
10
11
|
def filter; self[:Filter]; end
|
|
11
12
|
def sub_filter; self[:SubFilter]; end
|
|
@@ -42,7 +43,9 @@ module Pdfrb
|
|
|
42
43
|
end
|
|
43
44
|
|
|
44
45
|
def has_byte_range?
|
|
45
|
-
|
|
46
|
+
range = byte_range
|
|
47
|
+
range = range.to_a if range.is_a?(Pdfrb::Model::PdfArray)
|
|
48
|
+
range.is_a?(::Array) && range.size == 4
|
|
46
49
|
end
|
|
47
50
|
|
|
48
51
|
private
|
|
@@ -7,6 +7,7 @@ module Pdfrb
|
|
|
7
7
|
# build-data dict holding filter / PubSec / App / SigQ
|
|
8
8
|
# sub-dictionaries.
|
|
9
9
|
class SignatureBuildDataDict < Pdfrb::Model::Cos::Dictionary
|
|
10
|
+
arlington_object "SignatureBuildDataDict"
|
|
10
11
|
def filter; self[:Filter]; end
|
|
11
12
|
def pub_sec; self[:PubSec]; end
|
|
12
13
|
def app; self[:App]; end
|
|
@@ -23,6 +24,7 @@ module Pdfrb
|
|
|
23
24
|
|
|
24
25
|
# Signature Build Data App Dict (s12.8.4.2). Per-app info.
|
|
25
26
|
class SignatureBuildDataAppDict < Pdfrb::Model::Cos::Dictionary
|
|
27
|
+
arlington_object "SignatureBuildDataAppDict"
|
|
26
28
|
def name; self[:Name]; end
|
|
27
29
|
def date; self[:Date]; end
|
|
28
30
|
def r; self[:R]; end
|
|
@@ -33,6 +35,7 @@ module Pdfrb
|
|
|
33
35
|
# Signature Build Data SigQ Dict (s12.8.4.2). PKCS#7 signing
|
|
34
36
|
# request quality metadata.
|
|
35
37
|
class SignatureBuildDataSigQDict < Pdfrb::Model::Cos::Dictionary
|
|
38
|
+
arlington_object "SignatureBuildDataSigQDict"
|
|
36
39
|
def r; self[:R]; end
|
|
37
40
|
def q; self[:Q]; end
|
|
38
41
|
def hash; self[:HashAlgorithm]&.to_sym; end
|
|
@@ -45,6 +48,7 @@ module Pdfrb
|
|
|
45
48
|
# Signature Reference DocMDP (s12.8.2.2). DocMDP signature
|
|
46
49
|
# reference.
|
|
47
50
|
class SignatureReferenceDocMDP < Pdfrb::Model::Cos::Dictionary
|
|
51
|
+
arlington_object "SignatureReferenceDocMDP"
|
|
48
52
|
def type; self[:Type]; end
|
|
49
53
|
def digest_method; self[:DigestMethod]&.to_sym; end
|
|
50
54
|
|
|
@@ -56,12 +60,14 @@ module Pdfrb
|
|
|
56
60
|
# Signature Reference Identity (s12.8.2.2). Identity signature
|
|
57
61
|
# reference.
|
|
58
62
|
class SignatureReferenceIdentity < Pdfrb::Model::Cos::Dictionary
|
|
63
|
+
arlington_object "SignatureReferenceIdentity"
|
|
59
64
|
def type; self[:Type]; end
|
|
60
65
|
def digest_method; self[:DigestMethod]&.to_sym; end
|
|
61
66
|
end
|
|
62
67
|
|
|
63
68
|
# Signature Reference UR (Usage Rights, s12.8.2.3).
|
|
64
69
|
class SignatureReferenceUR < Pdfrb::Model::Cos::Dictionary
|
|
70
|
+
arlington_object "SignatureReferenceUR"
|
|
65
71
|
def type; self[:Type]; end
|
|
66
72
|
def digest_method; self[:DigestMethod]&.to_sym; end
|
|
67
73
|
def transform_params; self[:TransformParams]; end
|
|
@@ -77,6 +83,7 @@ module Pdfrb
|
|
|
77
83
|
# Signature Reference FieldMDP (s12.7.6.5). FieldMDP signature
|
|
78
84
|
# reference.
|
|
79
85
|
class SignatureReferenceFieldMDP < Pdfrb::Model::Cos::Dictionary
|
|
86
|
+
arlington_object "SignatureReferenceFieldMDP"
|
|
80
87
|
def type; self[:Type]; end
|
|
81
88
|
def digest_method; self[:DigestMethod]&.to_sym; end
|
|
82
89
|
def transform_params; self[:TransformParams]; end
|
data/lib/pdfrb/model/type.rb
CHANGED
|
@@ -71,6 +71,8 @@ module Pdfrb
|
|
|
71
71
|
autoload :OptContentLanguage, "pdfrb/model/type/opt_content_ext"
|
|
72
72
|
autoload :OptContentUsageApplication, "pdfrb/model/type/opt_content_ext"
|
|
73
73
|
autoload :OptContentPageElement, "pdfrb/model/type/opt_content_page_element"
|
|
74
|
+
autoload :OptContentUser, "pdfrb/model/type/opt_content_ext"
|
|
75
|
+
autoload :OptContentZoom, "pdfrb/model/type/opt_content_ext"
|
|
74
76
|
|
|
75
77
|
autoload :FileSpecification, "pdfrb/model/type/file_specification"
|
|
76
78
|
autoload :FileSpecEF, "pdfrb/model/type/file_spec_ef"
|
|
@@ -150,6 +152,19 @@ module Pdfrb
|
|
|
150
152
|
autoload :Pattern, "pdfrb/model/type/pattern"
|
|
151
153
|
autoload :PatternTiling, "pdfrb/model/type/pattern_tiling"
|
|
152
154
|
autoload :PatternShading, "pdfrb/model/type/pattern_shading"
|
|
155
|
+
autoload :PatternMap, "pdfrb/model/type/pattern"
|
|
156
|
+
|
|
157
|
+
# Shading family (s8.7.4).
|
|
158
|
+
autoload :ShadingCommon, "pdfrb/model/type/shading"
|
|
159
|
+
autoload :Shading, "pdfrb/model/type/shading"
|
|
160
|
+
autoload :ShadingType1, "pdfrb/model/type/shading"
|
|
161
|
+
autoload :ShadingType2, "pdfrb/model/type/shading"
|
|
162
|
+
autoload :ShadingType3, "pdfrb/model/type/shading"
|
|
163
|
+
autoload :ShadingType4, "pdfrb/model/type/shading"
|
|
164
|
+
autoload :ShadingType5, "pdfrb/model/type/shading"
|
|
165
|
+
autoload :ShadingType6, "pdfrb/model/type/shading"
|
|
166
|
+
autoload :ShadingType7, "pdfrb/model/type/shading"
|
|
167
|
+
autoload :ShadingMap, "pdfrb/model/type/shading"
|
|
153
168
|
|
|
154
169
|
# Font family.
|
|
155
170
|
autoload :Font, "pdfrb/model/type/font"
|
data/lib/pdfrb/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.29
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -1135,6 +1135,7 @@ files:
|
|
|
1135
1135
|
- lib/pdfrb/model/type/rich_media_window.rb
|
|
1136
1136
|
- lib/pdfrb/model/type/screen_annotation.rb
|
|
1137
1137
|
- lib/pdfrb/model/type/separation.rb
|
|
1138
|
+
- lib/pdfrb/model/type/shading.rb
|
|
1138
1139
|
- lib/pdfrb/model/type/sig_field_lock.rb
|
|
1139
1140
|
- lib/pdfrb/model/type/sig_field_seed_value.rb
|
|
1140
1141
|
- lib/pdfrb/model/type/signature.rb
|