pdfrb 0.7.34 → 0.7.35

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: 63bc7a84b2c25516f6471a8ef25aa513cd952ba83ea17b7bc3dd2c73171da943
4
- data.tar.gz: 8b0177a111dbdf1746f4ad128ec4c1a0fcd4d8d95ca74c8f429708f3c269290e
3
+ metadata.gz: ad01ecf1a7f70ecba1d47e315442c0bf8f855409126d234734e15f7e577b56ee
4
+ data.tar.gz: f51fd9f743922d396f5b2126cf6ae8e5dc6be4664969dc3f5cfa175642c15309
5
5
  SHA512:
6
- metadata.gz: 631ee3dcb0e45ac7ac4801491ab40aed9e8aeaea85bdc966d11ab7f1f06f498654a395d7a1ddc40be63fd8dbf3338a1fe72a6eb27e47ebce1dc3cb132b0e6841
7
- data.tar.gz: e744fa0dd1887afb443ba54f8605638a102c2f5e3e6174ab090bd6a31a970b0c07424d7ba3ce751c1f6a61b629df7f47a702152e767e7d08933e4dcff1e25140
6
+ metadata.gz: a58c6d6ab22846f316597741a0ab027e8b9859cf31e0f59e0e1b4dc99c6c07dcbe35e2d1d6a8aad055e9f8d3287a699a008e5c123b2c65d24cdc2bfab99beafc
7
+ data.tar.gz: a212dc856e1d245030cbabf346a896136c156ba9ef5444c300732974c94dee7c5ef4cb40aed1783cc305e9745b2b6b68fea17c9f9eef3ae8d927294832dc3f54
@@ -54,6 +54,21 @@ module Pdfrb
54
54
  def small_cap?; flags&.anybits?(0x20000); end
55
55
  def force_bold?; flags&.anybits?(0x40000); end
56
56
  end
57
+
58
+ # Font descriptor for TrueType fonts (s9.6.6.2): allows
59
+ # /FontFile2 embedding.
60
+ class FontDescriptorTrueType < FontDescriptor
61
+ arlington_object "FontDescriptorTrueType"
62
+
63
+ def font_file2; self[:FontFile2]; end
64
+ def font_file3; self[:FontFile3]; end
65
+ end
66
+
67
+ # Font descriptor for Type 3 fonts (s9.6.6.2): never carries
68
+ # font-file keys.
69
+ class FontDescriptorType3 < FontDescriptor
70
+ arlington_object "FontDescriptorType3"
71
+ end
57
72
  end
58
73
  end
59
74
  end
@@ -18,6 +18,25 @@ module Pdfrb
18
18
  def type1c?; subtype == :Type1C; end
19
19
  def truetype?; subtype == :TrueType; end
20
20
  end
21
+
22
+ # FontFile3 with /Subtype /Type1C: CFF glyph program for Type 1
23
+ # fonts (s9.6.6.2).
24
+ class FontFile3Type1 < FontFile3
25
+ arlington_object "FontFile3Type1"
26
+ end
27
+
28
+ # FontFile3 with /Subtype /CIDFontType0C: CFF program for CID
29
+ # fonts (s9.7.5.2).
30
+ class FontFile3CIDType0 < FontFile3
31
+ arlington_object "FontFile3CIDType0"
32
+ end
33
+
34
+ # FontFile3 with /Subtype /OpenType: OpenType wrapper whose
35
+ # table directory offsets are relative to the stream start
36
+ # (s9.6.6.4).
37
+ class FontFile3OpenType < FontFile3
38
+ arlington_object "FontFile3OpenType"
39
+ end
21
40
  end
22
41
  end
23
42
  end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Pdfrb
4
+ module Model
5
+ module Type
6
+ # Soft-mask dictionary /SMask in an ExtGState (s11.6.5.2).
7
+ # The transfer function TR and backdrop color BC apply while
8
+ # compositing the mask group G.
9
+ class SoftMaskAlpha < Pdfrb::Model::Cos::Dictionary
10
+ arlington_object "SoftMaskAlpha"
11
+
12
+ def type; self[:Type]; end
13
+ def subtype; self[:S]; end
14
+ def group; self[:G]; end
15
+ def backdrop_color; self[:BC]; end
16
+ def transfer_function; self[:TR]; end
17
+
18
+ def alpha?; true; end
19
+ def luminosity?; false; end
20
+ end
21
+
22
+ # Luminosity soft mask (s11.6.5.3): the group's luminosity
23
+ # drives the mask.
24
+ class SoftMaskLuminosity < Pdfrb::Model::Cos::Dictionary
25
+ arlington_object "SoftMaskLuminosity"
26
+
27
+ def type; self[:Type]; end
28
+ def subtype; self[:S]; end
29
+ def group; self[:G]; end
30
+ def backdrop_color; self[:BC]; end
31
+ def transfer_function; self[:TR]; end
32
+
33
+ def alpha?; false; end
34
+ def luminosity?; true; end
35
+ end
36
+
37
+ # Resources /ExtGState dictionary (s7.8.3): name ->
38
+ # ExtGState dictionaries.
39
+ class GraphicsStateParameterMap < Pdfrb::Model::Cos::Dictionary
40
+ arlington_object "GraphicsStateParameterMap"
41
+
42
+ def [](name)
43
+ value[name.to_sym] || value[name.to_s]
44
+ end
45
+
46
+ def add(name, parameters)
47
+ value[name.to_sym] = parameters
48
+ name.to_sym
49
+ end
50
+
51
+ def names
52
+ value.keys
53
+ end
54
+ end
55
+
56
+ # Transparency group /Group dictionary (s11.2.4.5): isolation
57
+ # and knockout flags, blending color space.
58
+ class GroupAttributes < Pdfrb::Model::Cos::Dictionary
59
+ arlington_object "GroupAttributes"
60
+
61
+ def type; self[:Type]; end
62
+ def subtype; self[:S]; end
63
+ def color_space; self[:CS]; end
64
+ def isolated?; self[:I] == true; end
65
+ def knockout?; self[:K] == true; end
66
+
67
+ def transparency_group?
68
+ subtype == :Transparency
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
@@ -49,6 +49,60 @@ module Pdfrb
49
49
  arr[0] == 1 && arr[1].zero? && arr[2].zero? && arr[3] == 1 && arr[4].zero? && arr[5].zero?
50
50
  end
51
51
  end
52
+
53
+ # PostScript XObject /Subtype /PS (s8.8.2): Level-1 PostScript
54
+ # fallback rendering.
55
+ class XObjectFormPS < Pdfrb::Model::Cos::Stream
56
+ arlington_object "XObjectFormPS"
57
+
58
+ def level1; self[:Level1]; end
59
+ end
60
+
61
+ # PostScript passthrough XObject (s8.8.2, PDF 1.3 PS extension
62
+ # /Subtype2 /PS): embedded PS consumed by passthrough printers.
63
+ class XObjectFormPSpassthrough < Pdfrb::Model::Cos::Stream
64
+ arlington_object "XObjectFormPSpassthrough"
65
+
66
+ def level1; self[:Level1]; end
67
+ def postscript; self[:PS]; end
68
+ end
69
+
70
+ # Printer's mark form XObject (s14.11.4): registration styles.
71
+ class XObjectFormPrinterMark < Pdfrb::Model::Cos::Stream
72
+ arlington_object "XObjectFormPrinterMark"
73
+
74
+ def mark_style; self[:MarkStyle]; end
75
+ def colorants; self[:Colorants]; end
76
+ end
77
+
78
+ # Trap network appearance form XObject (s14.11.2):
79
+ # trapping parameters.
80
+ class XObjectFormTrapNet < Pdfrb::Model::Cos::Stream
81
+ arlington_object "XObjectFormTrapNet"
82
+
83
+ def pcm; self[:PCM]; end
84
+ def separation_color_names; self[:SeparationColorNames]; end
85
+ def trap_regions; self[:TrapRegions]; end
86
+ def trap_styles; self[:TrapStyles]; end
87
+ end
88
+
89
+ # Resources /XObject dictionary (s7.8.3): name -> XObject.
90
+ class XObjectMap < Pdfrb::Model::Cos::Dictionary
91
+ arlington_object "XObjectMap"
92
+
93
+ def [](name)
94
+ value[name.to_sym] || value[name.to_s]
95
+ end
96
+
97
+ def add(name, xobject)
98
+ value[name.to_sym] = xobject
99
+ name.to_sym
100
+ end
101
+
102
+ def names
103
+ value.keys
104
+ end
105
+ end
52
106
  end
53
107
  end
54
108
  end
@@ -64,6 +64,28 @@ module Pdfrb
64
64
  ((width * components * bits_per_component) + 7) / 8
65
65
  end
66
66
  end
67
+
68
+ # Image-mask image XObject /ImageMask true (s8.9.6.4):
69
+ # 1-bpp stencil painted with the current fill color.
70
+ class XObjectImageMask < Pdfrb::Model::Cos::Stream
71
+ arlington_object "XObjectImageMask"
72
+
73
+ def width; self[:Width]; end
74
+ def height; self[:Height]; end
75
+ def decode; self[:Decode]; end
76
+
77
+ # /Decode [0 1] = paint 1-bits; [1 0] = inverted.
78
+ def inverted?; decode && decode[0] == 1; end
79
+ end
80
+
81
+ # Soft-mask image XObject (s8.9.6.5): grayscale companion used
82
+ # as a shape/opacity mask via /SMask.
83
+ class XObjectImageSoftMask < Pdfrb::Model::Cos::Stream
84
+ arlington_object "XObjectImageSoftMask"
85
+
86
+ def color_space; self[:ColorSpace]; end
87
+ def matte; self[:Matte]; end
88
+ end
67
89
  end
68
90
  end
69
91
  end
@@ -121,6 +121,22 @@ module Pdfrb
121
121
  autoload :FontDescriptorCIDType2, "pdfrb/model/type/font_descriptor_cid_type2"
122
122
  autoload :ToUnicodeCMapStream, "pdfrb/model/type/to_unicode_cmap_stream"
123
123
  autoload :XObjectForm, "pdfrb/model/type/xobject_form"
124
+ autoload :XObjectFormPS, "pdfrb/model/type/xobject_form"
125
+ autoload :XObjectFormPSpassthrough, "pdfrb/model/type/xobject_form"
126
+ autoload :XObjectFormPrinterMark, "pdfrb/model/type/xobject_form"
127
+ autoload :XObjectFormTrapNet, "pdfrb/model/type/xobject_form"
128
+ autoload :XObjectMap, "pdfrb/model/type/xobject_form"
129
+ autoload :XObjectImageMask, "pdfrb/model/type/xobject_image"
130
+ autoload :XObjectImageSoftMask, "pdfrb/model/type/xobject_image"
131
+ autoload :FontFile3Type1, "pdfrb/model/type/font_file3"
132
+ autoload :FontFile3CIDType0, "pdfrb/model/type/font_file3"
133
+ autoload :FontFile3OpenType, "pdfrb/model/type/font_file3"
134
+ autoload :FontDescriptorTrueType, "pdfrb/model/type/font_descriptor"
135
+ autoload :FontDescriptorType3, "pdfrb/model/type/font_descriptor"
136
+ autoload :SoftMaskAlpha, "pdfrb/model/type/soft_mask"
137
+ autoload :SoftMaskLuminosity, "pdfrb/model/type/soft_mask"
138
+ autoload :GraphicsStateParameterMap, "pdfrb/model/type/soft_mask"
139
+ autoload :GroupAttributes, "pdfrb/model/type/soft_mask"
124
140
  autoload :XObjectImage, "pdfrb/model/type/xobject_image"
125
141
 
126
142
  # Function family (s8.9).
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.34"
4
+ VERSION = "0.7.35"
5
5
  end
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.34
4
+ version: 0.7.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -1143,6 +1143,7 @@ files:
1143
1143
  - lib/pdfrb/model/type/signature.rb
1144
1144
  - lib/pdfrb/model/type/signature_build.rb
1145
1145
  - lib/pdfrb/model/type/signature_field.rb
1146
+ - lib/pdfrb/model/type/soft_mask.rb
1146
1147
  - lib/pdfrb/model/type/software_identifier.rb
1147
1148
  - lib/pdfrb/model/type/sound.rb
1148
1149
  - lib/pdfrb/model/type/sound_annotation.rb