origami 1.0.2
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.
- data/COPYING.LESSER +165 -0
- data/README +77 -0
- data/VERSION +1 -0
- data/bin/config/pdfcop.conf.yml +237 -0
- data/bin/gui/about.rb +46 -0
- data/bin/gui/config.rb +132 -0
- data/bin/gui/file.rb +385 -0
- data/bin/gui/hexdump.rb +74 -0
- data/bin/gui/hexview.rb +91 -0
- data/bin/gui/imgview.rb +72 -0
- data/bin/gui/menu.rb +392 -0
- data/bin/gui/properties.rb +132 -0
- data/bin/gui/signing.rb +635 -0
- data/bin/gui/textview.rb +107 -0
- data/bin/gui/treeview.rb +409 -0
- data/bin/gui/walker.rb +282 -0
- data/bin/gui/xrefs.rb +79 -0
- data/bin/pdf2graph +121 -0
- data/bin/pdf2ruby +353 -0
- data/bin/pdfcocoon +104 -0
- data/bin/pdfcop +455 -0
- data/bin/pdfdecompress +104 -0
- data/bin/pdfdecrypt +95 -0
- data/bin/pdfencrypt +112 -0
- data/bin/pdfextract +221 -0
- data/bin/pdfmetadata +123 -0
- data/bin/pdfsh +13 -0
- data/bin/pdfwalker +7 -0
- data/bin/shell/.irbrc +104 -0
- data/bin/shell/console.rb +136 -0
- data/bin/shell/hexdump.rb +83 -0
- data/origami.rb +36 -0
- data/origami/3d.rb +239 -0
- data/origami/acroform.rb +321 -0
- data/origami/actions.rb +299 -0
- data/origami/adobe/fdf.rb +259 -0
- data/origami/adobe/ppklite.rb +489 -0
- data/origami/annotations.rb +775 -0
- data/origami/array.rb +187 -0
- data/origami/boolean.rb +101 -0
- data/origami/catalog.rb +486 -0
- data/origami/destinations.rb +213 -0
- data/origami/dictionary.rb +188 -0
- data/origami/docmdp.rb +96 -0
- data/origami/encryption.rb +1293 -0
- data/origami/export.rb +283 -0
- data/origami/file.rb +222 -0
- data/origami/filters.rb +250 -0
- data/origami/filters/ascii.rb +189 -0
- data/origami/filters/ccitt.rb +515 -0
- data/origami/filters/crypt.rb +47 -0
- data/origami/filters/dct.rb +61 -0
- data/origami/filters/flate.rb +112 -0
- data/origami/filters/jbig2.rb +63 -0
- data/origami/filters/jpx.rb +53 -0
- data/origami/filters/lzw.rb +195 -0
- data/origami/filters/predictors.rb +276 -0
- data/origami/filters/runlength.rb +117 -0
- data/origami/font.rb +209 -0
- data/origami/functions.rb +93 -0
- data/origami/graphics.rb +33 -0
- data/origami/graphics/colors.rb +191 -0
- data/origami/graphics/instruction.rb +126 -0
- data/origami/graphics/path.rb +154 -0
- data/origami/graphics/patterns.rb +180 -0
- data/origami/graphics/state.rb +164 -0
- data/origami/graphics/text.rb +224 -0
- data/origami/graphics/xobject.rb +493 -0
- data/origami/header.rb +90 -0
- data/origami/linearization.rb +318 -0
- data/origami/metadata.rb +114 -0
- data/origami/name.rb +170 -0
- data/origami/null.rb +75 -0
- data/origami/numeric.rb +188 -0
- data/origami/obfuscation.rb +233 -0
- data/origami/object.rb +527 -0
- data/origami/outline.rb +59 -0
- data/origami/page.rb +559 -0
- data/origami/parser.rb +268 -0
- data/origami/parsers/fdf.rb +45 -0
- data/origami/parsers/pdf.rb +27 -0
- data/origami/parsers/pdf/linear.rb +113 -0
- data/origami/parsers/ppklite.rb +86 -0
- data/origami/pdf.rb +1144 -0
- data/origami/reference.rb +113 -0
- data/origami/signature.rb +474 -0
- data/origami/stream.rb +575 -0
- data/origami/string.rb +416 -0
- data/origami/trailer.rb +173 -0
- data/origami/webcapture.rb +87 -0
- data/origami/xfa.rb +3027 -0
- data/origami/xreftable.rb +447 -0
- data/templates/patterns.rb +66 -0
- data/templates/widgets.rb +173 -0
- data/templates/xdp.rb +92 -0
- data/tests/dataset/test.dummycrt +28 -0
- data/tests/dataset/test.dummykey +27 -0
- data/tests/tc_actions.rb +32 -0
- data/tests/tc_annotations.rb +85 -0
- data/tests/tc_pages.rb +37 -0
- data/tests/tc_pdfattach.rb +24 -0
- data/tests/tc_pdfencrypt.rb +110 -0
- data/tests/tc_pdfnew.rb +32 -0
- data/tests/tc_pdfparse.rb +98 -0
- data/tests/tc_pdfsig.rb +37 -0
- data/tests/tc_streams.rb +129 -0
- data/tests/ts_pdf.rb +45 -0
- metadata +193 -0
@@ -0,0 +1,213 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
= File
|
4
|
+
destinations.rb
|
5
|
+
|
6
|
+
= Info
|
7
|
+
This file is part of Origami, PDF manipulation framework for Ruby
|
8
|
+
Copyright (C) 2010 Guillaume Delugr� <guillaume@security-labs.org>
|
9
|
+
All right reserved.
|
10
|
+
|
11
|
+
Origami is free software: you can redistribute it and/or modify
|
12
|
+
it under the terms of the GNU Lesser General Public License as published by
|
13
|
+
the Free Software Foundation, either version 3 of the License, or
|
14
|
+
(at your option) any later version.
|
15
|
+
|
16
|
+
Origami is distributed in the hope that it will be useful,
|
17
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19
|
+
GNU Lesser General Public License for more details.
|
20
|
+
|
21
|
+
You should have received a copy of the GNU Lesser General Public License
|
22
|
+
along with Origami. If not, see <http://www.gnu.org/licenses/>.
|
23
|
+
|
24
|
+
=end
|
25
|
+
|
26
|
+
module Origami
|
27
|
+
|
28
|
+
class PDF
|
29
|
+
|
30
|
+
#
|
31
|
+
# Lookup destination in the destination name directory.
|
32
|
+
#
|
33
|
+
def get_destination_by_name(name)
|
34
|
+
resolve_name Names::Root::DESTS, name
|
35
|
+
end
|
36
|
+
|
37
|
+
#
|
38
|
+
# Calls block for each named destination.
|
39
|
+
#
|
40
|
+
def each_named_dest(&b)
|
41
|
+
each_name(Names::Root::DESTS, &b)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
#
|
46
|
+
# A destination represents a specified location into the document.
|
47
|
+
#
|
48
|
+
module Destination
|
49
|
+
|
50
|
+
attr_reader :top, :left, :right, :bottom, :zoom
|
51
|
+
|
52
|
+
#
|
53
|
+
# Class representing a Destination zooming on a part of a document.
|
54
|
+
#
|
55
|
+
class Zoom < Origami::Array
|
56
|
+
|
57
|
+
include Destination
|
58
|
+
|
59
|
+
#
|
60
|
+
# Creates a new zoom Destination.
|
61
|
+
# _pageref_:: A Reference to a Page.
|
62
|
+
# _left_, _top_:: Coords in the Page.
|
63
|
+
# _zoom_:: Zoom factor.
|
64
|
+
#
|
65
|
+
def initialize(pageref, left = 0, top = 0, zoom = 0)
|
66
|
+
|
67
|
+
@left, @top, @zoom = left, top, zoom
|
68
|
+
|
69
|
+
super([pageref, :XYZ, left, top, zoom])
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
#
|
76
|
+
# Class representing a Destination showing a Page globally.
|
77
|
+
#
|
78
|
+
class GlobalFit < Origami::Array
|
79
|
+
|
80
|
+
include Destination
|
81
|
+
|
82
|
+
#
|
83
|
+
# Creates a new global fit Destination.
|
84
|
+
# _pageref_:: A Reference to a Page.
|
85
|
+
#
|
86
|
+
def initialize(pageref)
|
87
|
+
super([pageref, :Fit])
|
88
|
+
end
|
89
|
+
|
90
|
+
end
|
91
|
+
|
92
|
+
#
|
93
|
+
# Class representing a Destination fitting a Page horizontally.
|
94
|
+
#
|
95
|
+
class HorizontalFit < Origami::Array
|
96
|
+
|
97
|
+
include Destination
|
98
|
+
|
99
|
+
#
|
100
|
+
# Creates a new horizontal fit destination.
|
101
|
+
# _pageref_:: A Reference to a Page.
|
102
|
+
# _top_:: The vertical coord in the Page.
|
103
|
+
#
|
104
|
+
def initialize(pageref, top = 0)
|
105
|
+
|
106
|
+
@top = top
|
107
|
+
super([pageref, :FitH, top])
|
108
|
+
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
|
113
|
+
#
|
114
|
+
# Class representing a Destination fitting a Page vertically.
|
115
|
+
# _pageref_:: A Reference to a Page.
|
116
|
+
# _left_:: The horizontal coord in the Page.
|
117
|
+
#
|
118
|
+
class VerticalFit < Origami::Array
|
119
|
+
|
120
|
+
include Destination
|
121
|
+
|
122
|
+
def initialize(pageref, left = 0)
|
123
|
+
|
124
|
+
@left = left
|
125
|
+
super([pageref, :FitV, left])
|
126
|
+
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
130
|
+
|
131
|
+
#
|
132
|
+
# Class representing a Destination fitting the view on a rectangle in a Page.
|
133
|
+
#
|
134
|
+
class RectangleFit < Origami::Array
|
135
|
+
|
136
|
+
include Destination
|
137
|
+
|
138
|
+
#
|
139
|
+
# Creates a new rectangle fit Destination.
|
140
|
+
# _pageref_:: A Reference to a Page.
|
141
|
+
# _left_, _bottom_, _right_, _top_:: The rectangle to fit in.
|
142
|
+
#
|
143
|
+
def initialize(pageref, left = 0, bottom = 0, right = 0, top = 0)
|
144
|
+
|
145
|
+
@left, @bottom, @right, @top = left, bottom, right, top
|
146
|
+
super([pageref, :FitR, left, bottom, right, top])
|
147
|
+
|
148
|
+
end
|
149
|
+
|
150
|
+
end
|
151
|
+
|
152
|
+
#
|
153
|
+
# Class representing a Destination fitting the bounding box of a Page.
|
154
|
+
#
|
155
|
+
class GlobalBoundingBoxFit < Origami::Array
|
156
|
+
|
157
|
+
include Destination
|
158
|
+
|
159
|
+
#
|
160
|
+
# Creates a new bounding box fit Destination.
|
161
|
+
# _pageref_:: A Reference to a Page.
|
162
|
+
#
|
163
|
+
def initialize(pageref)
|
164
|
+
super([pageref, :FitB])
|
165
|
+
end
|
166
|
+
|
167
|
+
end
|
168
|
+
|
169
|
+
#
|
170
|
+
# Class representing a Destination fitting horizontally the bouding box a Page.
|
171
|
+
#
|
172
|
+
class HorizontalBoudingBoxFit < Origami::Array
|
173
|
+
|
174
|
+
include Destination
|
175
|
+
|
176
|
+
#
|
177
|
+
# Creates a new horizontal bounding box fit Destination.
|
178
|
+
# _pageref_:: A Reference to a Page.
|
179
|
+
# _top_:: The vertical coord.
|
180
|
+
#
|
181
|
+
def initialize(pageref, top = 0)
|
182
|
+
|
183
|
+
@top = top
|
184
|
+
super([pageref, :FitBH, top])
|
185
|
+
|
186
|
+
end
|
187
|
+
|
188
|
+
end
|
189
|
+
|
190
|
+
#
|
191
|
+
# Class representing a Destination fitting vertically the bounding box of a Page.
|
192
|
+
#
|
193
|
+
class VerticalBoundingBoxFit < Origami::Array
|
194
|
+
|
195
|
+
include Destination
|
196
|
+
|
197
|
+
#
|
198
|
+
# Creates a new vertical bounding box fit Destination.
|
199
|
+
# _pageref_:: A Reference to a Page.
|
200
|
+
# _left_:: The horizontal coord.
|
201
|
+
#
|
202
|
+
def initialize(pageref, left = 0)
|
203
|
+
|
204
|
+
@left = left
|
205
|
+
super([pageref, :FitBV, left])
|
206
|
+
|
207
|
+
end
|
208
|
+
|
209
|
+
end
|
210
|
+
|
211
|
+
end
|
212
|
+
|
213
|
+
end
|
@@ -0,0 +1,188 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
= File
|
4
|
+
dictionary.rb
|
5
|
+
|
6
|
+
= Info
|
7
|
+
This file is part of Origami, PDF manipulation framework for Ruby
|
8
|
+
Copyright (C) 2010 Guillaume DelugrÈ <guillaume@security-labs.org>
|
9
|
+
All right reserved.
|
10
|
+
|
11
|
+
Origami is free software: you can redistribute it and/or modify
|
12
|
+
it under the terms of the GNU Lesser General Public License as published by
|
13
|
+
the Free Software Foundation, either version 3 of the License, or
|
14
|
+
(at your option) any later version.
|
15
|
+
|
16
|
+
Origami is distributed in the hope that it will be useful,
|
17
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19
|
+
GNU Lesser General Public License for more details.
|
20
|
+
|
21
|
+
You should have received a copy of the GNU Lesser General Public License
|
22
|
+
along with Origami. If not, see <http://www.gnu.org/licenses/>.
|
23
|
+
|
24
|
+
=end
|
25
|
+
|
26
|
+
module Origami
|
27
|
+
|
28
|
+
class InvalidDictionaryObjectError < InvalidObjectError #:nodoc:
|
29
|
+
end
|
30
|
+
|
31
|
+
#
|
32
|
+
# Class representing a Dictionary Object.
|
33
|
+
# Dictionaries are containers associating a Name to an embedded Object.
|
34
|
+
#
|
35
|
+
class Dictionary < Hash
|
36
|
+
include Origami::Object
|
37
|
+
|
38
|
+
TOKENS = %w{ << >> } #:nodoc:
|
39
|
+
@@regexp_open = Regexp.new(WHITESPACES + Regexp.escape(TOKENS.first) + WHITESPACES)
|
40
|
+
@@regexp_close = Regexp.new(WHITESPACES + Regexp.escape(TOKENS.last) + WHITESPACES)
|
41
|
+
|
42
|
+
attr_reader :strings_cache, :names_cache, :xref_cache
|
43
|
+
|
44
|
+
#
|
45
|
+
# Creates a new Dictionary.
|
46
|
+
# _hash_:: The hash representing the new Dictionary.
|
47
|
+
#
|
48
|
+
def initialize(hash = {})
|
49
|
+
raise TypeError, "Expected type Hash, received #{hash.class}." unless hash.is_a?(Hash)
|
50
|
+
super()
|
51
|
+
|
52
|
+
@strings_cache = []
|
53
|
+
@names_cache = []
|
54
|
+
@xref_cache = {}
|
55
|
+
|
56
|
+
hash.each_pair do |k,v|
|
57
|
+
@names_cache.push(k.to_o)
|
58
|
+
case val = v.to_o
|
59
|
+
when String then @strings_cache.push(val)
|
60
|
+
when Name then @names_cache.push(val)
|
61
|
+
when Reference then
|
62
|
+
(@xref_cache[val] ||= []).push(self)
|
63
|
+
when Dictionary,Array then
|
64
|
+
@strings_cache.concat(val.strings_cache)
|
65
|
+
@names_cache.concat(val.names_cache)
|
66
|
+
@xref_cache.update(val.xref_cache) do |ref, cache1, cache2|
|
67
|
+
cache1.concat(cache2)
|
68
|
+
end
|
69
|
+
|
70
|
+
val.strings_cache.clear
|
71
|
+
val.names_cache.clear
|
72
|
+
val.xref_cache.clear
|
73
|
+
end
|
74
|
+
|
75
|
+
self[k.to_o] = val unless k.nil?
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def self.parse(stream) #:nodoc:
|
80
|
+
|
81
|
+
offset = stream.pos
|
82
|
+
|
83
|
+
if stream.skip(@@regexp_open).nil?
|
84
|
+
raise InvalidDictionaryObjectError, "No token '#{TOKENS.first}' found"
|
85
|
+
end
|
86
|
+
|
87
|
+
pairs = {}
|
88
|
+
while stream.skip(@@regexp_close).nil? do
|
89
|
+
key = Name.parse(stream)
|
90
|
+
|
91
|
+
type = Object.typeof(stream)
|
92
|
+
if type.nil?
|
93
|
+
raise InvalidDictionaryObjectError, "Invalid object for field #{key.to_s}"
|
94
|
+
end
|
95
|
+
value = type.parse(stream)
|
96
|
+
|
97
|
+
pairs[key] = value
|
98
|
+
end
|
99
|
+
|
100
|
+
dict =
|
101
|
+
if Origami::OPTIONS[:enable_type_guessing]
|
102
|
+
type = pairs[Name.new(:Type)]
|
103
|
+
if type.is_a?(Name) and @@dict_special_types.include?(type.value)
|
104
|
+
@@dict_special_types[type.value].new(pairs)
|
105
|
+
else
|
106
|
+
Dictionary.new(pairs)
|
107
|
+
end
|
108
|
+
|
109
|
+
else
|
110
|
+
Dictionary.new(pairs)
|
111
|
+
end
|
112
|
+
|
113
|
+
dict.file_offset = offset
|
114
|
+
|
115
|
+
dict
|
116
|
+
end
|
117
|
+
|
118
|
+
alias to_h to_hash
|
119
|
+
|
120
|
+
def to_s(indent = 1) #:nodoc:
|
121
|
+
if indent > 0
|
122
|
+
content = TOKENS.first + EOL
|
123
|
+
self.each_pair do |key,value|
|
124
|
+
content << "\t" * indent + key.to_s + " " + (value.is_a?(Dictionary) ? value.to_s(indent + 1) : value.to_s) + EOL
|
125
|
+
end
|
126
|
+
|
127
|
+
content << "\t" * (indent - 1) + TOKENS.last
|
128
|
+
else
|
129
|
+
content = TOKENS.first.dup
|
130
|
+
self.each_pair do |key,value|
|
131
|
+
content << "#{key.to_s} #{value.is_a?(Dictionary) ? value.to_s(0) : value.to_s}"
|
132
|
+
end
|
133
|
+
content << TOKENS.last
|
134
|
+
end
|
135
|
+
|
136
|
+
super(content)
|
137
|
+
end
|
138
|
+
|
139
|
+
def map!(&b)
|
140
|
+
self.each_pair do |k,v|
|
141
|
+
self[k] = b.call(v)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
def merge(dict)
|
146
|
+
Dictionary.new(super(dict))
|
147
|
+
end
|
148
|
+
|
149
|
+
def []=(key,val)
|
150
|
+
unless key.is_a?(Symbol) or key.is_a?(Name)
|
151
|
+
fail "Expecting a Name for a Dictionary entry, found #{key.class} instead."
|
152
|
+
end
|
153
|
+
|
154
|
+
key = key.to_o
|
155
|
+
if not val.nil?
|
156
|
+
val = val.to_o
|
157
|
+
super(key,val)
|
158
|
+
|
159
|
+
key.parent = self
|
160
|
+
val.parent = self unless val.is_indirect? or val.parent.equal?(self)
|
161
|
+
|
162
|
+
val
|
163
|
+
else
|
164
|
+
delete(key)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
def [](key)
|
169
|
+
super(key.to_o)
|
170
|
+
end
|
171
|
+
|
172
|
+
def has_key?(key)
|
173
|
+
super(key.to_o)
|
174
|
+
end
|
175
|
+
|
176
|
+
def delete(key)
|
177
|
+
super(key.to_o)
|
178
|
+
end
|
179
|
+
|
180
|
+
alias each each_value
|
181
|
+
|
182
|
+
def real_type ; Dictionary end
|
183
|
+
|
184
|
+
alias value to_h
|
185
|
+
|
186
|
+
end #class
|
187
|
+
|
188
|
+
end # Origami
|
data/origami/docmdp.rb
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
= File
|
4
|
+
docmdp.rb
|
5
|
+
|
6
|
+
= Info
|
7
|
+
This file is part of Origami, PDF manipulation framework for Ruby
|
8
|
+
Copyright (C) 2010 Guillaume Delugr� <guillaume@security-labs.org>
|
9
|
+
All right reserved.
|
10
|
+
|
11
|
+
Origami is free software: you can redistribute it and/or modify
|
12
|
+
it under the terms of the GNU Lesser General Public License as published by
|
13
|
+
the Free Software Foundation, either version 3 of the License, or
|
14
|
+
(at your option) any later version.
|
15
|
+
|
16
|
+
Origami is distributed in the hope that it will be useful,
|
17
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
18
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
19
|
+
GNU Lesser General Public License for more details.
|
20
|
+
|
21
|
+
You should have received a copy of the GNU Lesser General Public License
|
22
|
+
along with Origami. If not, see <http://www.gnu.org/licenses/>.
|
23
|
+
|
24
|
+
=end
|
25
|
+
|
26
|
+
module Origami
|
27
|
+
|
28
|
+
class Null
|
29
|
+
def to_docmdp_str
|
30
|
+
"\000"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
class Integer
|
35
|
+
def to_docmdp_str
|
36
|
+
[ 1, self.value & 0xFFFFFFFF ].pack("CN")
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
class Real
|
41
|
+
def to_docmdp_str
|
42
|
+
[ 2, self.value.round & 0xFFFFFFFF ].pack("CN")
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
class Boolean
|
47
|
+
def to_docmdp_str
|
48
|
+
[ 3, (self.false?) ? 0 : 1 ].pack("CN")
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
class Name
|
53
|
+
def to_docmdp_str
|
54
|
+
[ 4, self.to_s.length, self.to_s ].pack("CNA*")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
class String
|
59
|
+
def to_docmdp_str
|
60
|
+
[ 5, self.to_s.length, self.to_s ].pack("CNA*")
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
class Dictionary
|
65
|
+
def to_docmdp_str(*fields)
|
66
|
+
if fields.empty?
|
67
|
+
self.each_pair { |key, value|
|
68
|
+
|
69
|
+
}
|
70
|
+
else
|
71
|
+
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
class Array
|
77
|
+
def to_docmdp_str
|
78
|
+
str = [ 7, self.length ].pack("CN")
|
79
|
+
|
80
|
+
self.each do |obj|
|
81
|
+
str << obj.to_docmdp_str
|
82
|
+
end
|
83
|
+
|
84
|
+
str
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
class Stream
|
89
|
+
def to_docmdp_str
|
90
|
+
[ 8, self.dictionary.size ].pack("CN") +
|
91
|
+
self.dictionary.to_docmdp_str(:DecodeParms, :F, :FDecodeParms, :FFilter, :Filter, :Length) +
|
92
|
+
[ self.rawdata.length, self.rawdata ].pack("NA*")
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|