pdfrb 0.7.34 → 0.7.36
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/font_descriptor.rb +15 -0
- data/lib/pdfrb/model/type/font_file3.rb +19 -0
- data/lib/pdfrb/model/type/geospatial.rb +75 -0
- data/lib/pdfrb/model/type/opi.rb +51 -0
- data/lib/pdfrb/model/type/rich_media_presentation.rb +42 -0
- data/lib/pdfrb/model/type/soft_mask.rb +73 -0
- data/lib/pdfrb/model/type/structure_attributes.rb +57 -0
- data/lib/pdfrb/model/type/xobject_form.rb +54 -0
- data/lib/pdfrb/model/type/xobject_image.rb +22 -0
- data/lib/pdfrb/model/type.rb +40 -0
- data/lib/pdfrb/version.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3740e5c530080b0edb5bae1c91fa903c7e1f3bfefd0d98a293b33bd809bb2ca1
|
|
4
|
+
data.tar.gz: 992edd43f900f4503e43862a3e63e30785794bd00a2f64c10870d362d5527b41
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 821f34c0ab86bd434058838c3776f5509ef8779b8ad728932e7a1163019d46e7ccde664eabb5457944a15138edb33aeeb229b299ef7ce0e5228207017c5d40e4
|
|
7
|
+
data.tar.gz: 2e579118cdf84ef58c268c3e10a245b6b880a631eac1770932db8ebed1bffea0cdc3a238da32124322187555a00a467deae01eaf07b0d2563fc48eaac4d52e2a
|
|
@@ -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,75 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pdfrb
|
|
4
|
+
module Model
|
|
5
|
+
module Type
|
|
6
|
+
# Geographic coordinate system dictionary (s11.5, /GCS):
|
|
7
|
+
# identifies a datum via EPSG code or WKT.
|
|
8
|
+
class GeographicCoordinateSystem < Pdfrb::Model::Cos::Dictionary
|
|
9
|
+
arlington_object "GeographicCoordinateSystem"
|
|
10
|
+
|
|
11
|
+
def type; self[:Type]; end
|
|
12
|
+
def epsg; self[:EPSG]; end
|
|
13
|
+
def wkt; self[:WKT]; end
|
|
14
|
+
|
|
15
|
+
def epsg_defined?
|
|
16
|
+
!epsg.nil?
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Projected coordinate system dictionary (s11.5, /DCS):
|
|
21
|
+
# projection plus its underlying geographic system.
|
|
22
|
+
class ProjectedCoordinateSystem < Pdfrb::Model::Cos::Dictionary
|
|
23
|
+
arlington_object "ProjectedCoordinateSystem"
|
|
24
|
+
|
|
25
|
+
def type; self[:Type]; end
|
|
26
|
+
def epsg; self[:EPSG]; end
|
|
27
|
+
def wkt; self[:WKT]; end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Point-data dictionary (s11.5, /PtData): named point arrays
|
|
31
|
+
# mapping geographic to page coordinates.
|
|
32
|
+
class PointData < Pdfrb::Model::Cos::Dictionary
|
|
33
|
+
arlington_object "PointData"
|
|
34
|
+
|
|
35
|
+
def type; self[:Type]; end
|
|
36
|
+
def subtype; self[:Subtype]; end
|
|
37
|
+
def names; self[:Names]; end
|
|
38
|
+
def xpts; self[:XPTS]; end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Projection dictionary (s11.5, 3D annotation /Projection):
|
|
42
|
+
# how 3D content is projected to the page.
|
|
43
|
+
class Projection < Pdfrb::Model::Cos::Dictionary
|
|
44
|
+
arlington_object "Projection"
|
|
45
|
+
|
|
46
|
+
def subtype; self[:Subtype]; end
|
|
47
|
+
def color_space; self[:CS]; end
|
|
48
|
+
def focal_length; self[:F]; end
|
|
49
|
+
def near; self[:N]; end
|
|
50
|
+
def field_of_view; self[:FOV]; end
|
|
51
|
+
def projection_scale; self[:PS]; end
|
|
52
|
+
def orthographic_scale; self[:OS]; end
|
|
53
|
+
def clipping_bbox; self[:OB]; end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Number format dictionary (s11.4.2): unit, precision, and
|
|
57
|
+
# denominators for measurement display.
|
|
58
|
+
class NumberFormat < Pdfrb::Model::Cos::Dictionary
|
|
59
|
+
arlington_object "NumberFormat"
|
|
60
|
+
|
|
61
|
+
def type; self[:Type]; end
|
|
62
|
+
def unit; self[:U]; end
|
|
63
|
+
def conversion_factor; self[:C]; end
|
|
64
|
+
def fractional_digits; self[:F]; end
|
|
65
|
+
def denominator; self[:D]; end
|
|
66
|
+
def fd; self[:FD]; end
|
|
67
|
+
def fraction_display_type; self[:RT]; end
|
|
68
|
+
def rounding_type; self[:RD]; end
|
|
69
|
+
def thousands_separator; self[:PS]; end
|
|
70
|
+
def negative_style; self[:SS]; end
|
|
71
|
+
def pre_text; self[:O]; end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pdfrb
|
|
4
|
+
module Model
|
|
5
|
+
module Type
|
|
6
|
+
# OPI version 1.3 dictionary (s14.11.6, deprecated 2.0):
|
|
7
|
+
# low-resolution proxy information for OPI workflows.
|
|
8
|
+
class OPIVersion13Dict < Pdfrb::Model::Cos::Dictionary
|
|
9
|
+
arlington_object "OPIVersion13Dict"
|
|
10
|
+
|
|
11
|
+
def version; self[:Version]; end
|
|
12
|
+
def file_spec; self[:F]; end
|
|
13
|
+
def id; self[:ID]; end
|
|
14
|
+
def comments; self[:Comments]; end
|
|
15
|
+
def size; self[:Size]; end
|
|
16
|
+
def crop_rect; self[:CropRect]; end
|
|
17
|
+
def crop_fixed; self[:CropFixed]; end
|
|
18
|
+
def position; self[:Position]; end
|
|
19
|
+
def resolution; self[:Resolution]; end
|
|
20
|
+
def color_type; self[:ColorType]; end
|
|
21
|
+
def color; self[:Color]; end
|
|
22
|
+
def tint; self[:Tint]; end
|
|
23
|
+
def overprint; self[:Overprint]; end
|
|
24
|
+
def image_type; self[:ImageType]; end
|
|
25
|
+
def gray_map; self[:GrayMap]; end
|
|
26
|
+
def transparency; self[:Transparency]; end
|
|
27
|
+
def tags; self[:Tags]; end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# OPI version 2.0 dictionary (s14.11.6, deprecated 2.0).
|
|
31
|
+
class OPIVersion20Dict < Pdfrb::Model::Cos::Dictionary
|
|
32
|
+
arlington_object "OPIVersion20Dict"
|
|
33
|
+
|
|
34
|
+
def version; self[:Version]; end
|
|
35
|
+
def file_spec; self[:F]; end
|
|
36
|
+
def id; self[:ID]; end
|
|
37
|
+
def comments; self[:Comments]; end
|
|
38
|
+
def size; self[:Size]; end
|
|
39
|
+
def crop_rect; self[:CropRect]; end
|
|
40
|
+
def position; self[:Position]; end
|
|
41
|
+
def resolution; self[:Resolution]; end
|
|
42
|
+
def color_type; self[:ColorType]; end
|
|
43
|
+
def tint; self[:Tint]; end
|
|
44
|
+
def overprint; self[:Overprint]; end
|
|
45
|
+
def image_type; self[:ImageType]; end
|
|
46
|
+
def transparency; self[:Transparency]; end
|
|
47
|
+
def tags; self[:Tags]; end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -25,6 +25,48 @@ module Pdfrb
|
|
|
25
25
|
document.object(ref)
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
|
+
|
|
29
|
+
# RichMedia instance /Params (s13.6.2.9): FlashVars, bindings,
|
|
30
|
+
# and cue points.
|
|
31
|
+
class RichMediaParams < Pdfrb::Model::Cos::Dictionary
|
|
32
|
+
arlington_object "RichMediaParams"
|
|
33
|
+
|
|
34
|
+
def flash_vars; self[:FlashVars]; end
|
|
35
|
+
def binding; self[:Binding]; end
|
|
36
|
+
def binding_material; self[:BindingMaterial]; end
|
|
37
|
+
def cue_points; self[:CuePoints]; end
|
|
38
|
+
def settings; self[:Settings]; end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# RichMedia height constraints (s13.6.9.5): /Default /Max /Min
|
|
42
|
+
# in percentages of window height.
|
|
43
|
+
class RichMediaHeight < Pdfrb::Model::Cos::Dictionary
|
|
44
|
+
arlington_object "RichMediaHeight"
|
|
45
|
+
|
|
46
|
+
def default; self[:Default]; end
|
|
47
|
+
def max; self[:Max]; end
|
|
48
|
+
def min; self[:Min]; end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# RichMedia width constraints (s13.6.9.5).
|
|
52
|
+
class RichMediaWidth < Pdfrb::Model::Cos::Dictionary
|
|
53
|
+
arlington_object "RichMediaWidth"
|
|
54
|
+
|
|
55
|
+
def default; self[:Default]; end
|
|
56
|
+
def max; self[:Max]; end
|
|
57
|
+
def min; self[:Min]; end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# RichMedia window/content positioning (s13.6.9.5): alignment
|
|
61
|
+
# and offsets.
|
|
62
|
+
class RichMediaPosition < Pdfrb::Model::Cos::Dictionary
|
|
63
|
+
arlington_object "RichMediaPosition"
|
|
64
|
+
|
|
65
|
+
def h_align; self[:HAlign]; end
|
|
66
|
+
def v_align; self[:VAlign]; end
|
|
67
|
+
def h_offset; self[:HOffset]; end
|
|
68
|
+
def v_offset; self[:VOffset]; end
|
|
69
|
+
end
|
|
28
70
|
end
|
|
29
71
|
end
|
|
30
72
|
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
|
|
@@ -7,6 +7,7 @@ module Pdfrb
|
|
|
7
7
|
# attributes — owner + per-owner attribute fields (Layout, Table,
|
|
8
8
|
# List, PrintField, etc.).
|
|
9
9
|
class StructureAttributes < Pdfrb::Model::Cos::Dictionary
|
|
10
|
+
arlington_object "StructureAttributesDict"
|
|
10
11
|
def owner; self[:O]; end
|
|
11
12
|
def namespace; self[:NS]; end
|
|
12
13
|
def placement; self[:Placement]&.to_sym; end
|
|
@@ -39,6 +40,62 @@ module Pdfrb
|
|
|
39
40
|
!!namespace
|
|
40
41
|
end
|
|
41
42
|
end
|
|
43
|
+
|
|
44
|
+
# Role map (s14.7.3, StructTreeRoot /RoleMap): custom element
|
|
45
|
+
# names mapped to standard structure types.
|
|
46
|
+
class RoleMap < Pdfrb::Model::Cos::Dictionary
|
|
47
|
+
arlington_object "RoleMap"
|
|
48
|
+
|
|
49
|
+
def [](custom_name)
|
|
50
|
+
value[custom_name.to_sym] || value[custom_name.to_s]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def custom_names
|
|
54
|
+
value.keys
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Namespaced role map (s14.7.3, /RoleMapNS): per-namespace role
|
|
59
|
+
# maps keyed by namespace URI.
|
|
60
|
+
class RoleMapNS < Pdfrb::Model::Cos::Dictionary
|
|
61
|
+
arlington_object "RoleMapNS"
|
|
62
|
+
|
|
63
|
+
def [](namespace)
|
|
64
|
+
value[namespace.to_sym] || value[namespace.to_s]
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Style dictionary (s14.9.2, /Styles entries): number-of-style
|
|
69
|
+
# to style-attributes mapping with an optional /Panose.
|
|
70
|
+
class StyleDict < Pdfrb::Model::Cos::Dictionary
|
|
71
|
+
arlington_object "StyleDict"
|
|
72
|
+
|
|
73
|
+
def panose; self[:Panose]; end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Class map (s14.7.4, StructTreeRoot /ClassMap): reusable
|
|
77
|
+
# attribute-owner dictionaries shared by structure elements.
|
|
78
|
+
class ClassMap < Pdfrb::Model::Cos::Dictionary
|
|
79
|
+
arlington_object "ClassMap"
|
|
80
|
+
|
|
81
|
+
def [](class_name)
|
|
82
|
+
value[class_name.to_sym] || value[class_name.to_s]
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def class_names
|
|
86
|
+
value.keys
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Reference structure element kid (s14.8.2.4, /Reference):
|
|
91
|
+
# points at content elsewhere via /F file, /Page, /ID.
|
|
92
|
+
class StructureReference < Pdfrb::Model::Cos::Dictionary
|
|
93
|
+
arlington_object "Reference"
|
|
94
|
+
|
|
95
|
+
def file; self[:F]; end
|
|
96
|
+
def page; self[:Page]; end
|
|
97
|
+
def ids; self[:ID]; end
|
|
98
|
+
end
|
|
42
99
|
end
|
|
43
100
|
end
|
|
44
101
|
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
|
data/lib/pdfrb/model/type.rb
CHANGED
|
@@ -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).
|
|
@@ -509,6 +525,30 @@ module Pdfrb
|
|
|
509
525
|
autoload :AddActionScreenAnnotation, "pdfrb/model/type/add_action_screen_annotation"
|
|
510
526
|
autoload :AddActionWidgetAnnotation, "pdfrb/model/type/add_action_widget_annotation"
|
|
511
527
|
|
|
528
|
+
# Geospatial support (s11.5) + number formats (s11.4).
|
|
529
|
+
autoload :GeographicCoordinateSystem, "pdfrb/model/type/geospatial"
|
|
530
|
+
autoload :ProjectedCoordinateSystem, "pdfrb/model/type/geospatial"
|
|
531
|
+
autoload :PointData, "pdfrb/model/type/geospatial"
|
|
532
|
+
autoload :Projection, "pdfrb/model/type/geospatial"
|
|
533
|
+
autoload :NumberFormat, "pdfrb/model/type/geospatial"
|
|
534
|
+
|
|
535
|
+
# OPI proxy dictionaries (s14.11.6, deprecated 2.0).
|
|
536
|
+
autoload :OPIVersion13Dict, "pdfrb/model/type/opi"
|
|
537
|
+
autoload :OPIVersion20Dict, "pdfrb/model/type/opi"
|
|
538
|
+
|
|
539
|
+
# RichMedia sizing/positioning (s13.6.9.5).
|
|
540
|
+
autoload :RichMediaParams, "pdfrb/model/type/rich_media_presentation"
|
|
541
|
+
autoload :RichMediaHeight, "pdfrb/model/type/rich_media_presentation"
|
|
542
|
+
autoload :RichMediaWidth, "pdfrb/model/type/rich_media_presentation"
|
|
543
|
+
autoload :RichMediaPosition, "pdfrb/model/type/rich_media_presentation"
|
|
544
|
+
|
|
545
|
+
# Structure tree maps + references (s14.7, s14.8).
|
|
546
|
+
autoload :RoleMap, "pdfrb/model/type/structure_attributes"
|
|
547
|
+
autoload :RoleMapNS, "pdfrb/model/type/structure_attributes"
|
|
548
|
+
autoload :StyleDict, "pdfrb/model/type/structure_attributes"
|
|
549
|
+
autoload :ClassMap, "pdfrb/model/type/structure_attributes"
|
|
550
|
+
autoload :StructureReference, "pdfrb/model/type/structure_attributes"
|
|
551
|
+
|
|
512
552
|
# Requirements handlers (s7.9.2, Catalog /Requirements).
|
|
513
553
|
autoload :Requirements3DMarkup, "pdfrb/model/type/requirements"
|
|
514
554
|
autoload :RequirementsAcroFormInteract, "pdfrb/model/type/requirements"
|
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.36
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -1060,6 +1060,7 @@ files:
|
|
|
1060
1060
|
- lib/pdfrb/model/type/function_sampled.rb
|
|
1061
1061
|
- lib/pdfrb/model/type/function_stitching.rb
|
|
1062
1062
|
- lib/pdfrb/model/type/generic_appearance.rb
|
|
1063
|
+
- lib/pdfrb/model/type/geospatial.rb
|
|
1063
1064
|
- lib/pdfrb/model/type/graphics_state_parameter.rb
|
|
1064
1065
|
- lib/pdfrb/model/type/halftone.rb
|
|
1065
1066
|
- lib/pdfrb/model/type/halftone_type1.rb
|
|
@@ -1096,6 +1097,7 @@ files:
|
|
|
1096
1097
|
- lib/pdfrb/model/type/namespace.rb
|
|
1097
1098
|
- lib/pdfrb/model/type/object_reference.rb
|
|
1098
1099
|
- lib/pdfrb/model/type/object_stream.rb
|
|
1100
|
+
- lib/pdfrb/model/type/opi.rb
|
|
1099
1101
|
- lib/pdfrb/model/type/opt_content_ext.rb
|
|
1100
1102
|
- lib/pdfrb/model/type/opt_content_page_element.rb
|
|
1101
1103
|
- lib/pdfrb/model/type/optional_content_config.rb
|
|
@@ -1143,6 +1145,7 @@ files:
|
|
|
1143
1145
|
- lib/pdfrb/model/type/signature.rb
|
|
1144
1146
|
- lib/pdfrb/model/type/signature_build.rb
|
|
1145
1147
|
- lib/pdfrb/model/type/signature_field.rb
|
|
1148
|
+
- lib/pdfrb/model/type/soft_mask.rb
|
|
1146
1149
|
- lib/pdfrb/model/type/software_identifier.rb
|
|
1147
1150
|
- lib/pdfrb/model/type/sound.rb
|
|
1148
1151
|
- lib/pdfrb/model/type/sound_annotation.rb
|