pdfrb 0.7.29 → 0.7.31
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/button.rb +17 -0
- data/lib/pdfrb/model/type/choice.rb +1 -0
- data/lib/pdfrb/model/type/device_n.rb +12 -6
- data/lib/pdfrb/model/type/device_n_mixing_hints.rb +1 -0
- data/lib/pdfrb/model/type/device_n_process.rb +1 -0
- data/lib/pdfrb/model/type/embedded_file_parameter.rb +1 -0
- data/lib/pdfrb/model/type/file_spec_ef.rb +1 -0
- data/lib/pdfrb/model/type/file_spec_rf.rb +1 -0
- data/lib/pdfrb/model/type/form_field.rb +1 -0
- data/lib/pdfrb/model/type/icon_fit.rb +1 -0
- data/lib/pdfrb/model/type/mark_information.rb +1 -0
- data/lib/pdfrb/model/type/marked_content_reference.rb +1 -0
- data/lib/pdfrb/model/type/measure.rb +23 -0
- data/lib/pdfrb/model/type/namespace.rb +1 -0
- data/lib/pdfrb/model/type/object_reference.rb +1 -0
- data/lib/pdfrb/model/type/page_piece_info.rb +1 -0
- data/lib/pdfrb/model/type/separation.rb +5 -5
- data/lib/pdfrb/model/type/signature_field.rb +1 -0
- data/lib/pdfrb/model/type/software_identifier.rb +1 -0
- data/lib/pdfrb/model/type/text_field.rb +1 -0
- data/lib/pdfrb/model/type/transition.rb +4 -0
- data/lib/pdfrb/model/type/ur_transform_parameters.rb +1 -0
- data/lib/pdfrb/model/type/uri_dict.rb +1 -0
- data/lib/pdfrb/model/type/url_alias.rb +1 -0
- data/lib/pdfrb/model/type/viewer_preferences.rb +1 -0
- data/lib/pdfrb/model/type.rb +8 -0
- data/lib/pdfrb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 477baf83aeea6245724da9acdf754de37f90c24c210a86ca2da935a30634dec0
|
|
4
|
+
data.tar.gz: f871f4bb91ede07091487d953ef28604397db256f054216474e1006f55fcf95a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f3daf7059880972579adc591b6d8f648e7c031743794257aab14905859ac7a62e805c631ee1d9b16215415bcd276c2effbdbfa8070b679b0542b24989ac2585f
|
|
7
|
+
data.tar.gz: ab06fa9aebbcc46b2e9fbd1b054d591b5bfa512c13c0ea2ccbbc51973b64e3107b885120923015249250ad206d3bda3ebb9eff6d1a700961d842cb673c7db7fc
|
|
@@ -9,9 +9,26 @@ module Pdfrb
|
|
|
9
9
|
|
|
10
10
|
def push_button?; flags & 0x10000 != 0; end
|
|
11
11
|
def radio?; flags & 0x8000 != 0; end
|
|
12
|
+
def checkbox?; !push_button? && !radio?; end
|
|
12
13
|
def no_toggle_to_off?; flags & 0x4000 != 0; end
|
|
13
14
|
def radios_in_unison?; flags & 0x2000000 != 0; end
|
|
14
15
|
end
|
|
16
|
+
|
|
17
|
+
# Checkbox button field (s12.7.4.2.2, /Ft /Btn without push or
|
|
18
|
+
# radio flags).
|
|
19
|
+
class CheckboxButton < Button
|
|
20
|
+
arlington_object "FieldBtnCheckbox"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Pushbutton field (s12.7.4.2.4).
|
|
24
|
+
class PushButton < Button
|
|
25
|
+
arlington_object "FieldBtnPush"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Radio button field (s12.7.4.2.3).
|
|
29
|
+
class RadioButton < Button
|
|
30
|
+
arlington_object "FieldBtnRadio"
|
|
31
|
+
end
|
|
15
32
|
end
|
|
16
33
|
end
|
|
17
34
|
end
|
|
@@ -3,13 +3,19 @@
|
|
|
3
3
|
module Pdfrb
|
|
4
4
|
module Model
|
|
5
5
|
module Type
|
|
6
|
-
# DeviceN
|
|
7
|
-
#
|
|
6
|
+
# DeviceN attributes dictionary (s8.6.6.4, the 5th element of
|
|
7
|
+
# the DeviceN color space array). Names extra colorants and
|
|
8
|
+
# process/mixing hints.
|
|
8
9
|
class DeviceN < Pdfrb::Model::Cos::Dictionary
|
|
9
|
-
|
|
10
|
-
def
|
|
11
|
-
def
|
|
12
|
-
def
|
|
10
|
+
arlington_object "DeviceNDict"
|
|
11
|
+
def subtype; self[:Subtype]&.to_sym; end
|
|
12
|
+
def colorants; self[:Colorants]; end
|
|
13
|
+
def process; self[:Process]; end
|
|
14
|
+
def mixing_hints; self[:MixingHints]; end
|
|
15
|
+
|
|
16
|
+
def nchannel?
|
|
17
|
+
subtype == :NChannel
|
|
18
|
+
end
|
|
13
19
|
|
|
14
20
|
def colorant_count
|
|
15
21
|
return 0 unless colorants
|
|
@@ -5,6 +5,7 @@ module Pdfrb
|
|
|
5
5
|
module Type
|
|
6
6
|
# DeviceN Mixing Hints (s8.6.6.5). Per-colorant device hints.
|
|
7
7
|
class DeviceNMixingHints < Pdfrb::Model::Cos::Dictionary
|
|
8
|
+
arlington_object "DeviceNMixingHints"
|
|
8
9
|
def solidities; self[:Solidities]; end
|
|
9
10
|
def dot_gain; self[:DotGain]; end
|
|
10
11
|
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# EmbeddedFileParameterDictionary (s7.11.3.1). Per /EF entry
|
|
7
7
|
# /Params dict — checksum, size, dates, mac creator.
|
|
8
8
|
class EmbeddedFileParameter < Pdfrb::Model::Cos::Dictionary
|
|
9
|
+
arlington_object "EmbeddedFileParameter"
|
|
9
10
|
def size; self[:Size]; end
|
|
10
11
|
def creation_date; self[:CreationDate]; end
|
|
11
12
|
def modification_date; self[:ModDate]; end
|
|
@@ -7,6 +7,7 @@ module Pdfrb
|
|
|
7
7
|
# EmbeddedFile stream reference: /F (type 1), /UF (Unicode),
|
|
8
8
|
# /DOS, /Mac, /Unix.
|
|
9
9
|
class FileSpecEF < Pdfrb::Model::Cos::Dictionary
|
|
10
|
+
arlington_object "FileSpecEF"
|
|
10
11
|
def primary_file; self[:F]; end
|
|
11
12
|
def unicode_file; self[:UF]; end
|
|
12
13
|
def dos_file; self[:DOS]; end
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# MarkInformation (s14.7.1). Catalog /MarkInfo — flags whether
|
|
7
7
|
# the document is tagged and structural metadata is reliable.
|
|
8
8
|
class MarkInformation < Cos::Dictionary
|
|
9
|
+
arlington_object "MarkInfo"
|
|
9
10
|
register_type :MarkInfo
|
|
10
11
|
|
|
11
12
|
def type; self[:Type]; end
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# Measure dictionary (s11.4). Used by line/poly annotations and
|
|
7
7
|
# XObjects to map PDF units to real-world units.
|
|
8
8
|
class Measure < Cos::Dictionary
|
|
9
|
+
arlington_object "MeasureRL"
|
|
9
10
|
register_type :Measure
|
|
10
11
|
|
|
11
12
|
def type; self[:Type]; end
|
|
@@ -34,6 +35,28 @@ module Pdfrb
|
|
|
34
35
|
!!area_format
|
|
35
36
|
end
|
|
36
37
|
end
|
|
38
|
+
|
|
39
|
+
# Geospatial Measure dictionary (s11.4, /Subtype /GEO with
|
|
40
|
+
# GCS/DCS). Maps geographic coordinates onto page geometry.
|
|
41
|
+
class GeospatialMeasure < Pdfrb::Model::Cos::Dictionary
|
|
42
|
+
arlington_object "MeasureGEO"
|
|
43
|
+
|
|
44
|
+
def type; self[:Type]; end
|
|
45
|
+
def subtype; self[:Subtype]; end
|
|
46
|
+
def bounds; self[:Bounds]; end
|
|
47
|
+
def geographic_coordinate_system; self[:GCS]; end
|
|
48
|
+
def projected_coordinate_system; self[:DCS]; end
|
|
49
|
+
def pdu; self[:PDU]; end
|
|
50
|
+
def gpts; self[:GPTS]; end
|
|
51
|
+
def lpts; self[:LPTS]; end
|
|
52
|
+
def pcsm; self[:PCSM]; end
|
|
53
|
+
|
|
54
|
+
def bound_count
|
|
55
|
+
arr = bounds
|
|
56
|
+
arr = arr.to_a if arr.is_a?(Pdfrb::Model::PdfArray)
|
|
57
|
+
arr&.size
|
|
58
|
+
end
|
|
59
|
+
end
|
|
37
60
|
end
|
|
38
61
|
end
|
|
39
62
|
end
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# Object reference dict (s14.7.6). Used in structure trees to
|
|
7
7
|
# refer to a content item without including it directly.
|
|
8
8
|
class ObjectReference < Cos::Dictionary
|
|
9
|
+
arlington_object "ObjectReference"
|
|
9
10
|
register_type :ObjRef
|
|
10
11
|
|
|
11
12
|
def type; self[:Type]; end
|
|
@@ -12,6 +12,7 @@ module Pdfrb
|
|
|
12
12
|
# Conforming readers MUST NOT interpret application-private
|
|
13
13
|
# data; it survives round-trips and incremental updates intact.
|
|
14
14
|
class PagePieceInfo < Pdfrb::Model::Cos::Dictionary
|
|
15
|
+
arlington_object "PagePiece"
|
|
15
16
|
# The application-name key (e.g. :Adobe, :Pdfrb). Multiple
|
|
16
17
|
# applications may each have their own entry in the same
|
|
17
18
|
# /PieceInfo dict.
|
|
@@ -7,11 +7,11 @@ module Pdfrb
|
|
|
7
7
|
# mapped through a tint-transform function. Used for spot colors
|
|
8
8
|
# like PANTONE 185 C.
|
|
9
9
|
class Separation < Pdfrb::Model::Cos::Dictionary
|
|
10
|
-
|
|
11
|
-
def
|
|
12
|
-
def
|
|
13
|
-
|
|
14
|
-
def
|
|
10
|
+
arlington_object "Separation"
|
|
11
|
+
def color_space; self[:ColorSpace]; end
|
|
12
|
+
def device_colorant; self[:DeviceColorant]; end
|
|
13
|
+
def key; self[:Key]; end
|
|
14
|
+
def pages; self[:Pages]; end
|
|
15
15
|
|
|
16
16
|
def resolved_tint_transform
|
|
17
17
|
ref = tint_transform
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# Software Identifier (s13.3.5.5). Identifies a player for
|
|
7
7
|
# media rendering.
|
|
8
8
|
class SoftwareIdentifier < Pdfrb::Model::Cos::Dictionary
|
|
9
|
+
arlington_object "SoftwareIdentifier"
|
|
9
10
|
def type; self[:Type]; end
|
|
10
11
|
def u; self[:U]; end
|
|
11
12
|
def l; self[:L]; end
|
|
@@ -7,6 +7,7 @@ module Pdfrb
|
|
|
7
7
|
# pages in FullScreen mode. Lives on Page /Trans or on an
|
|
8
8
|
# ActionTrans.
|
|
9
9
|
class Transition < Pdfrb::Model::Cos::Dictionary
|
|
10
|
+
arlington_object "Transition"
|
|
10
11
|
def type; self[:Type]; end
|
|
11
12
|
def style; self[:S]&.to_sym; end
|
|
12
13
|
def duration; self[:D]; end
|
|
@@ -38,6 +39,7 @@ module Pdfrb
|
|
|
38
39
|
# Printer Mark sub-dictionary (s12.5.6.18). Per-printer-mark
|
|
39
40
|
# sub-parameters.
|
|
40
41
|
class PrinterMarkSubDict < Pdfrb::Model::Cos::Dictionary
|
|
42
|
+
arlington_object "AppearancePrinterMarkSubDict"
|
|
41
43
|
def printer; self[:PRINTER]; end
|
|
42
44
|
def credentials; self[:CREDS]; end
|
|
43
45
|
end
|
|
@@ -45,6 +47,7 @@ module Pdfrb
|
|
|
45
47
|
# ExData 3D Markup (s13.6.1). 3D scene metadata for Projection
|
|
46
48
|
# annotations / 3D models.
|
|
47
49
|
class ExData3DMarkup < Pdfrb::Model::Cos::Dictionary
|
|
50
|
+
arlington_object "ExData3DMarkup"
|
|
48
51
|
def type; self[:Type]; end
|
|
49
52
|
def v3d; self[:V3D]; end
|
|
50
53
|
|
|
@@ -56,6 +59,7 @@ module Pdfrb
|
|
|
56
59
|
# ExData Markup Geo (s12.5.6.21). Geo-spatial markup attached to
|
|
57
60
|
# a Projection annotation.
|
|
58
61
|
class ExDataMarkupGeo < Pdfrb::Model::Cos::Dictionary
|
|
62
|
+
arlington_object "ExDataMarkupGeo"
|
|
59
63
|
def type; self[:Type]; end
|
|
60
64
|
def coordinate_path; self[:CoordinatePath]; end
|
|
61
65
|
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# UR Transform Parameters (s12.8.2.3). Adobe Reader-enabled
|
|
7
7
|
# usage rights — annotations, form fill-in, signatures allowed.
|
|
8
8
|
class URTransformParameters < Pdfrb::Model::Cos::Dictionary
|
|
9
|
+
arlington_object "URTransformParameters"
|
|
9
10
|
def type; self[:Type]; end
|
|
10
11
|
def annotations; self[:Annots]; end
|
|
11
12
|
def form; self[:Form]; end
|
|
@@ -6,6 +6,7 @@ module Pdfrb
|
|
|
6
6
|
# URL Alias (s7.9.6). Names dictionary entry mapping friendly
|
|
7
7
|
# URLs to actual URLs for collection sub-items.
|
|
8
8
|
class URLAlias < Pdfrb::Model::Cos::Dictionary
|
|
9
|
+
arlington_object "URLAlias"
|
|
9
10
|
def type; self[:Type]; end
|
|
10
11
|
def alias_value; self[:U]; end
|
|
11
12
|
def url; self[:URL]; end
|
data/lib/pdfrb/model/type.rb
CHANGED
|
@@ -93,16 +93,21 @@ module Pdfrb
|
|
|
93
93
|
autoload :LineEndingStyling, "pdfrb/model/type/line_ending_styling"
|
|
94
94
|
autoload :InteriorColor, "pdfrb/model/type/interior_color"
|
|
95
95
|
autoload :ObjectReference, "pdfrb/model/type/object_reference"
|
|
96
|
+
autoload :Namespace, "pdfrb/model/type/namespace"
|
|
96
97
|
autoload :SquareCircle, "pdfrb/model/type/square_circle"
|
|
97
98
|
autoload :VariableTextField, "pdfrb/model/type/variable_text_field"
|
|
98
99
|
autoload :DocumentSecurityStore, "pdfrb/model/type/document_security_store"
|
|
99
100
|
autoload :Measure, "pdfrb/model/type/measure"
|
|
101
|
+
autoload :GeospatialMeasure, "pdfrb/model/type/measure"
|
|
100
102
|
autoload :OptionalContentConfiguration, "pdfrb/model/type/optional_content_config"
|
|
101
103
|
autoload :MarkedContentReference, "pdfrb/model/type/marked_content_reference"
|
|
102
104
|
autoload :AppearanceGenerator, "pdfrb/model/type/appearance_generator"
|
|
103
105
|
autoload :Field, "pdfrb/model/type/form_field"
|
|
104
106
|
autoload :TextField, "pdfrb/model/type/text_field"
|
|
105
107
|
autoload :Button, "pdfrb/model/type/button"
|
|
108
|
+
autoload :CheckboxButton, "pdfrb/model/type/button"
|
|
109
|
+
autoload :PushButton, "pdfrb/model/type/button"
|
|
110
|
+
autoload :RadioButton, "pdfrb/model/type/button"
|
|
106
111
|
autoload :Choice, "pdfrb/model/type/choice"
|
|
107
112
|
autoload :SignatureField, "pdfrb/model/type/signature_field"
|
|
108
113
|
autoload :ViewerPreferences, "pdfrb/model/type/viewer_preferences"
|
|
@@ -402,6 +407,9 @@ module Pdfrb
|
|
|
402
407
|
autoload :Field, "pdfrb/model/type/form_field"
|
|
403
408
|
autoload :TextField, "pdfrb/model/type/text_field"
|
|
404
409
|
autoload :Button, "pdfrb/model/type/button"
|
|
410
|
+
autoload :CheckboxButton, "pdfrb/model/type/button"
|
|
411
|
+
autoload :PushButton, "pdfrb/model/type/button"
|
|
412
|
+
autoload :RadioButton, "pdfrb/model/type/button"
|
|
405
413
|
autoload :Choice, "pdfrb/model/type/choice"
|
|
406
414
|
autoload :SignatureField, "pdfrb/model/type/signature_field"
|
|
407
415
|
|
data/lib/pdfrb/version.rb
CHANGED