pdf-reader 2.5.0 → 2.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +42 -0
- data/README.md +16 -1
- data/Rakefile +1 -1
- data/examples/extract_fonts.rb +12 -7
- data/examples/rspec.rb +1 -0
- data/lib/pdf/reader/aes_v2_security_handler.rb +41 -0
- data/lib/pdf/reader/aes_v3_security_handler.rb +38 -0
- data/lib/pdf/reader/bounding_rectangle_runs_filter.rb +16 -0
- data/lib/pdf/reader/buffer.rb +90 -46
- data/lib/pdf/reader/cid_widths.rb +1 -0
- data/lib/pdf/reader/cmap.rb +65 -50
- data/lib/pdf/reader/encoding.rb +3 -2
- data/lib/pdf/reader/error.rb +19 -3
- data/lib/pdf/reader/filter/ascii85.rb +7 -1
- data/lib/pdf/reader/filter/ascii_hex.rb +6 -1
- data/lib/pdf/reader/filter/depredict.rb +11 -9
- data/lib/pdf/reader/filter/flate.rb +4 -2
- data/lib/pdf/reader/filter/lzw.rb +2 -0
- data/lib/pdf/reader/filter/null.rb +1 -1
- data/lib/pdf/reader/filter/run_length.rb +19 -13
- data/lib/pdf/reader/filter.rb +2 -1
- data/lib/pdf/reader/font.rb +72 -16
- data/lib/pdf/reader/font_descriptor.rb +19 -17
- data/lib/pdf/reader/form_xobject.rb +15 -5
- data/lib/pdf/reader/glyph_hash.rb +16 -9
- data/lib/pdf/reader/glyphlist-zapfdingbats.txt +245 -0
- data/lib/pdf/reader/key_builder_v5.rb +138 -0
- data/lib/pdf/reader/lzw.rb +4 -2
- data/lib/pdf/reader/null_security_handler.rb +1 -4
- data/lib/pdf/reader/object_cache.rb +1 -0
- data/lib/pdf/reader/object_hash.rb +252 -44
- data/lib/pdf/reader/object_stream.rb +1 -0
- data/lib/pdf/reader/overlapping_runs_filter.rb +11 -4
- data/lib/pdf/reader/page.rb +99 -19
- data/lib/pdf/reader/page_layout.rb +36 -37
- data/lib/pdf/reader/page_state.rb +12 -11
- data/lib/pdf/reader/page_text_receiver.rb +57 -10
- data/lib/pdf/reader/pages_strategy.rb +1 -0
- data/lib/pdf/reader/parser.rb +23 -12
- data/lib/pdf/reader/point.rb +25 -0
- data/lib/pdf/reader/print_receiver.rb +1 -0
- data/lib/pdf/reader/rc4_security_handler.rb +38 -0
- data/lib/pdf/reader/rectangle.rb +113 -0
- data/lib/pdf/reader/reference.rb +1 -0
- data/lib/pdf/reader/register_receiver.rb +1 -0
- data/lib/pdf/reader/{resource_methods.rb → resources.rb} +16 -9
- data/lib/pdf/reader/security_handler_factory.rb +79 -0
- data/lib/pdf/reader/{standard_security_handler.rb → standard_key_builder.rb} +23 -94
- data/lib/pdf/reader/stream.rb +2 -1
- data/lib/pdf/reader/synchronized_cache.rb +1 -0
- data/lib/pdf/reader/text_run.rb +14 -6
- data/lib/pdf/reader/token.rb +1 -0
- data/lib/pdf/reader/transformation_matrix.rb +1 -0
- data/lib/pdf/reader/type_check.rb +52 -0
- data/lib/pdf/reader/unimplemented_security_handler.rb +1 -0
- data/lib/pdf/reader/validating_receiver.rb +262 -0
- data/lib/pdf/reader/width_calculator/built_in.rb +1 -0
- data/lib/pdf/reader/width_calculator/composite.rb +1 -0
- data/lib/pdf/reader/width_calculator/true_type.rb +2 -1
- data/lib/pdf/reader/width_calculator/type_one_or_three.rb +1 -0
- data/lib/pdf/reader/width_calculator/type_zero.rb +1 -0
- data/lib/pdf/reader/width_calculator.rb +1 -0
- data/lib/pdf/reader/xref.rb +27 -4
- data/lib/pdf/reader/zero_width_runs_filter.rb +13 -0
- data/lib/pdf/reader.rb +46 -15
- data/lib/pdf-reader.rb +1 -0
- data/rbi/pdf-reader.rbi +1978 -0
- metadata +21 -10
- data/lib/pdf/reader/orientation_detector.rb +0 -34
- data/lib/pdf/reader/standard_security_handler_v5.rb +0 -91
data/rbi/pdf-reader.rbi
ADDED
@@ -0,0 +1,1978 @@
|
|
1
|
+
# typed: strong
|
2
|
+
module PDF
|
3
|
+
class Reader
|
4
|
+
sig { returns(T.untyped) }
|
5
|
+
attr_reader :objects
|
6
|
+
|
7
|
+
sig { params(input: T.any(String, IO), opts: T::Hash[T.untyped, T.untyped]).void }
|
8
|
+
def initialize(input, opts = {}); end
|
9
|
+
|
10
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
11
|
+
def info; end
|
12
|
+
|
13
|
+
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
|
14
|
+
def metadata; end
|
15
|
+
|
16
|
+
sig { returns(Integer) }
|
17
|
+
def page_count; end
|
18
|
+
|
19
|
+
sig { returns(Float) }
|
20
|
+
def pdf_version; end
|
21
|
+
|
22
|
+
sig { params(input: T.any(String, IO), opts: T::Hash[T.untyped, T.untyped], block: T.proc.params(arg0: PDF::Reader).void).returns(T.untyped) }
|
23
|
+
def self.open(input, opts = {}, &block); end
|
24
|
+
|
25
|
+
sig { returns(T::Array[PDF::Reader::Page]) }
|
26
|
+
def pages; end
|
27
|
+
|
28
|
+
sig { params(num: Integer).returns(PDF::Reader::Page) }
|
29
|
+
def page(num); end
|
30
|
+
|
31
|
+
sig { params(obj: T.untyped).returns(T.untyped) }
|
32
|
+
def doc_strings_to_utf8(obj); end
|
33
|
+
|
34
|
+
sig { params(str: String).returns(T::Boolean)}
|
35
|
+
def has_utf16_bom?(str); end
|
36
|
+
|
37
|
+
sig { params(obj: String).returns(String) }
|
38
|
+
def pdfdoc_to_utf8(obj); end
|
39
|
+
|
40
|
+
sig { params(obj: String).returns(String) }
|
41
|
+
def utf16_to_utf8(obj); end
|
42
|
+
|
43
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
44
|
+
def root; end
|
45
|
+
|
46
|
+
class AesV2SecurityHandler
|
47
|
+
sig { params(key: String).void }
|
48
|
+
def initialize(key)
|
49
|
+
@encrypt_key = T.let(T.unsafe(nil), String)
|
50
|
+
end
|
51
|
+
|
52
|
+
sig { params(buf: String, ref: PDF::Reader::Reference).returns(String) }
|
53
|
+
def decrypt(buf, ref); end
|
54
|
+
end
|
55
|
+
|
56
|
+
class AesV3SecurityHandler
|
57
|
+
sig { params(key: String).void }
|
58
|
+
def initialize(key)
|
59
|
+
@encrypt_key = T.let(T.unsafe(nil), String)
|
60
|
+
@cipher = T.let(T.unsafe(nil), String)
|
61
|
+
end
|
62
|
+
|
63
|
+
sig { params(buf: String, ref: PDF::Reader::Reference).returns(String) }
|
64
|
+
def decrypt(buf, ref); end
|
65
|
+
end
|
66
|
+
|
67
|
+
class BoundingRectangleRunsFilter
|
68
|
+
sig { params(runs: T::Array[PDF::Reader::TextRun], rect: PDF::Reader::Rectangle).returns(T::Array[PDF::Reader::TextRun]) }
|
69
|
+
def self.runs_within_rect(runs, rect); end
|
70
|
+
end
|
71
|
+
|
72
|
+
class Buffer
|
73
|
+
TOKEN_WHITESPACE = [0x00, 0x09, 0x0A, 0x0C, 0x0D, 0x20]
|
74
|
+
TOKEN_DELIMITER = [0x25, 0x3C, 0x3E, 0x28, 0x5B, 0x7B, 0x29, 0x5D, 0x7D, 0x2F]
|
75
|
+
LEFT_PAREN = "("
|
76
|
+
LESS_THAN = "<"
|
77
|
+
STREAM = "stream"
|
78
|
+
ID = "ID"
|
79
|
+
FWD_SLASH = "/"
|
80
|
+
NULL_BYTE = "\x00"
|
81
|
+
CR = "\r"
|
82
|
+
LF = "\n"
|
83
|
+
CRLF = "\r\n"
|
84
|
+
WHITE_SPACE = [LF, CR, ' ']
|
85
|
+
TRAILING_BYTECOUNT = 5000
|
86
|
+
|
87
|
+
sig { returns(Integer) }
|
88
|
+
attr_reader :pos
|
89
|
+
|
90
|
+
sig { params(io: T.any(StringIO, File), opts: T::Hash[Symbol, T.untyped]).void }
|
91
|
+
def initialize(io, opts = {})
|
92
|
+
@pos = T.let(T.unsafe(nil), Integer)
|
93
|
+
@tokens = T.let(T.unsafe(nil), T::Array[T.any(String, PDF::Reader::Reference)])
|
94
|
+
@io = T.let(T.unsafe(nil), T.any(StringIO, File))
|
95
|
+
@in_content_stream = T.let(T.unsafe(nil), T::Boolean)
|
96
|
+
end
|
97
|
+
|
98
|
+
sig { returns(T::Boolean) }
|
99
|
+
def empty?; end
|
100
|
+
|
101
|
+
sig { params(bytes: Integer, opts: T::Hash[Symbol, T.untyped]).returns(T.nilable(String)) }
|
102
|
+
def read(bytes, opts = {}); end
|
103
|
+
|
104
|
+
sig { returns(T.any(NilClass, String, PDF::Reader::Reference)) }
|
105
|
+
def token; end
|
106
|
+
|
107
|
+
sig { returns(Integer) }
|
108
|
+
def find_first_xref_offset; end
|
109
|
+
|
110
|
+
sig { void }
|
111
|
+
def check_size_is_non_zero; end
|
112
|
+
|
113
|
+
sig { returns(T::Boolean) }
|
114
|
+
def in_content_stream?; end
|
115
|
+
|
116
|
+
sig { void }
|
117
|
+
def reset_pos; end
|
118
|
+
|
119
|
+
sig { void }
|
120
|
+
def save_pos; end
|
121
|
+
|
122
|
+
sig { void }
|
123
|
+
def prepare_tokens; end
|
124
|
+
|
125
|
+
sig { returns(Symbol) }
|
126
|
+
def state; end
|
127
|
+
|
128
|
+
sig { void }
|
129
|
+
def merge_indirect_reference; end
|
130
|
+
|
131
|
+
sig { void }
|
132
|
+
def prepare_inline_token; end
|
133
|
+
|
134
|
+
sig { void }
|
135
|
+
def prepare_hex_token; end
|
136
|
+
|
137
|
+
sig { void }
|
138
|
+
def prepare_literal_token; end
|
139
|
+
|
140
|
+
sig { void }
|
141
|
+
def prepare_regular_token; end
|
142
|
+
|
143
|
+
sig { returns(T.nilable(Integer)) }
|
144
|
+
def peek_byte; end
|
145
|
+
end
|
146
|
+
|
147
|
+
class CidWidths
|
148
|
+
sig { params(default: T.untyped, array: T.untyped).void }
|
149
|
+
def initialize(default, array); end
|
150
|
+
|
151
|
+
sig { params(default: T.untyped, array: T.untyped).returns(T.untyped) }
|
152
|
+
def parse_array(default, array); end
|
153
|
+
|
154
|
+
sig { params(first: T.untyped, widths: T.untyped).returns(T.untyped) }
|
155
|
+
def parse_first_form(first, widths); end
|
156
|
+
|
157
|
+
sig { params(first: T.untyped, final: T.untyped, width: T.untyped).returns(T.untyped) }
|
158
|
+
def parse_second_form(first, final, width); end
|
159
|
+
end
|
160
|
+
|
161
|
+
class CMap
|
162
|
+
CMAP_KEYWORDS = {
|
163
|
+
"begincodespacerange" => 1,
|
164
|
+
"endcodespacerange" => 1,
|
165
|
+
"beginbfchar" => 1,
|
166
|
+
"endbfchar" => 1,
|
167
|
+
"beginbfrange" => 1,
|
168
|
+
"endbfrange" => 1,
|
169
|
+
"begin" => 1,
|
170
|
+
"begincmap" => 1,
|
171
|
+
"def" => 1
|
172
|
+
}
|
173
|
+
|
174
|
+
sig { returns(T.untyped) }
|
175
|
+
attr_reader :map
|
176
|
+
|
177
|
+
sig { params(data: String).void }
|
178
|
+
def initialize(data)
|
179
|
+
@map = T.let(T.unsafe(nil), T::Hash[Integer, T::Array[Integer]])
|
180
|
+
end
|
181
|
+
|
182
|
+
sig { params(data: String, initial_mode: Symbol).void }
|
183
|
+
def process_data(data, initial_mode = :none); end
|
184
|
+
|
185
|
+
sig { returns(Integer) }
|
186
|
+
def size; end
|
187
|
+
|
188
|
+
sig { params(c: Integer).returns(T::Array[Integer]) }
|
189
|
+
def decode(c); end
|
190
|
+
|
191
|
+
sig { params(instructions: String).returns(PDF::Reader::Parser) }
|
192
|
+
def build_parser(instructions); end
|
193
|
+
|
194
|
+
sig { params(str: String).returns(T::Array[Integer]) }
|
195
|
+
def str_to_int(str); end
|
196
|
+
|
197
|
+
sig { params(instructions: T::Array[String]).void }
|
198
|
+
def process_bfchar_instructions(instructions); end
|
199
|
+
|
200
|
+
sig { params(instructions: T::Array[T.any(T::Array[String], String)]).void }
|
201
|
+
def process_bfrange_instructions(instructions); end
|
202
|
+
|
203
|
+
sig { params(start_code: String, end_code: String, dst: String).void }
|
204
|
+
def bfrange_type_one(start_code, end_code, dst); end
|
205
|
+
|
206
|
+
sig { params(start_code: String, end_code: String, dst: T::Array[String]).void }
|
207
|
+
def bfrange_type_two(start_code, end_code, dst); end
|
208
|
+
end
|
209
|
+
|
210
|
+
class Encoding
|
211
|
+
CONTROL_CHARS = [0,1,2,3,4,5,6,7,8,11,12,14,15,16,17,18,19,20,21,22,23,
|
212
|
+
24,25,26,27,28,29,30,31]
|
213
|
+
UNKNOWN_CHAR = 0x25AF
|
214
|
+
|
215
|
+
sig { returns(T.untyped) }
|
216
|
+
attr_reader :unpack
|
217
|
+
|
218
|
+
sig { params(enc: T.untyped).void }
|
219
|
+
def initialize(enc); end
|
220
|
+
|
221
|
+
sig { params(diff: T.untyped).returns(T.untyped) }
|
222
|
+
def differences=(diff); end
|
223
|
+
|
224
|
+
sig { returns(T.untyped) }
|
225
|
+
def differences; end
|
226
|
+
|
227
|
+
sig { params(str: String).returns(String) }
|
228
|
+
def to_utf8(str); end
|
229
|
+
|
230
|
+
sig { params(glyph_code: Integer).returns(String) }
|
231
|
+
def int_to_utf8_string(glyph_code); end
|
232
|
+
|
233
|
+
sig { params(glyph_code: Integer).returns(T::Array[Symbol]) }
|
234
|
+
def int_to_name(glyph_code); end
|
235
|
+
|
236
|
+
sig { returns(T.untyped) }
|
237
|
+
def default_mapping; end
|
238
|
+
|
239
|
+
sig { params(glyph_code: T.untyped).returns(T.untyped) }
|
240
|
+
def internal_int_to_utf8_string(glyph_code); end
|
241
|
+
|
242
|
+
sig { returns(T.untyped) }
|
243
|
+
def utf8_conversion_impossible?; end
|
244
|
+
|
245
|
+
sig { params(times: T.untyped).returns(T.untyped) }
|
246
|
+
def little_boxes(times); end
|
247
|
+
|
248
|
+
sig { params(str: T.untyped).returns(T.untyped) }
|
249
|
+
def convert_to_utf8(str); end
|
250
|
+
|
251
|
+
sig { params(enc: T.untyped).returns(T.untyped) }
|
252
|
+
def get_unpack(enc); end
|
253
|
+
|
254
|
+
sig { params(enc: T.untyped).returns(T.untyped) }
|
255
|
+
def get_mapping_file(enc); end
|
256
|
+
|
257
|
+
sig { returns(T.untyped) }
|
258
|
+
def glyphlist; end
|
259
|
+
|
260
|
+
sig { params(file: T.untyped).returns(T.untyped) }
|
261
|
+
def load_mapping(file); end
|
262
|
+
end
|
263
|
+
|
264
|
+
class Error
|
265
|
+
sig { params(lvalue: T.untyped, rvalue: T.untyped, chars: T.untyped).returns(T.untyped) }
|
266
|
+
def self.str_assert(lvalue, rvalue, chars = nil); end
|
267
|
+
|
268
|
+
sig { params(lvalue: T.untyped, rvalue: T.untyped, chars: T.untyped).returns(T.untyped) }
|
269
|
+
def self.str_assert_not(lvalue, rvalue, chars = nil); end
|
270
|
+
|
271
|
+
sig { params(lvalue: T.untyped, rvalue: T.untyped).returns(T.untyped) }
|
272
|
+
def self.assert_equal(lvalue, rvalue); end
|
273
|
+
|
274
|
+
sig { params(object: Object, name: String, klass: Module).void }
|
275
|
+
def self.validate_type(object, name, klass); end
|
276
|
+
|
277
|
+
sig { params(object: Object, name: String, klass: Module).void }
|
278
|
+
def self.validate_type_as_malformed(object, name, klass); end
|
279
|
+
|
280
|
+
sig { params(object: Object, name: String).void }
|
281
|
+
def self.validate_not_nil(object, name); end
|
282
|
+
|
283
|
+
sig { params(object: Object, name: String).void }
|
284
|
+
def self.validate_not_nil_as_malformed(object, name); end
|
285
|
+
end
|
286
|
+
|
287
|
+
class MalformedPDFError < RuntimeError
|
288
|
+
end
|
289
|
+
|
290
|
+
class InvalidPageError < ArgumentError
|
291
|
+
end
|
292
|
+
|
293
|
+
class InvalidObjectError < MalformedPDFError
|
294
|
+
end
|
295
|
+
|
296
|
+
class UnsupportedFeatureError < RuntimeError
|
297
|
+
end
|
298
|
+
|
299
|
+
class EncryptedPDFError < UnsupportedFeatureError
|
300
|
+
end
|
301
|
+
|
302
|
+
class Font
|
303
|
+
sig { returns(T.untyped) }
|
304
|
+
attr_accessor :subtype
|
305
|
+
|
306
|
+
sig { returns(T.untyped) }
|
307
|
+
attr_accessor :encoding
|
308
|
+
|
309
|
+
sig { returns(T.untyped) }
|
310
|
+
attr_accessor :descendantfonts
|
311
|
+
|
312
|
+
sig { returns(T.untyped) }
|
313
|
+
attr_accessor :tounicode
|
314
|
+
|
315
|
+
sig { returns(T.untyped) }
|
316
|
+
attr_reader :widths
|
317
|
+
|
318
|
+
sig { returns(T.untyped) }
|
319
|
+
attr_reader :first_char
|
320
|
+
|
321
|
+
sig { returns(T.untyped) }
|
322
|
+
attr_reader :last_char
|
323
|
+
|
324
|
+
sig { returns(T.untyped) }
|
325
|
+
attr_reader :basefont
|
326
|
+
|
327
|
+
sig { returns(T.untyped) }
|
328
|
+
attr_reader :font_descriptor
|
329
|
+
|
330
|
+
sig { returns(T.untyped) }
|
331
|
+
attr_reader :cid_widths
|
332
|
+
|
333
|
+
sig { returns(T.untyped) }
|
334
|
+
attr_reader :cid_default_width
|
335
|
+
|
336
|
+
sig { params(ohash: T.untyped, obj: T.untyped).void }
|
337
|
+
def initialize(ohash, obj); end
|
338
|
+
|
339
|
+
sig { params(params: T.untyped).returns(T.untyped) }
|
340
|
+
def to_utf8(params); end
|
341
|
+
|
342
|
+
sig { params(data: T.untyped).returns(T.untyped) }
|
343
|
+
def unpack(data); end
|
344
|
+
|
345
|
+
sig { params(code_point: T.untyped).returns(T.untyped) }
|
346
|
+
def glyph_width(code_point); end
|
347
|
+
|
348
|
+
sig { params(font_name: T.untyped).returns(T.untyped) }
|
349
|
+
def default_encoding(font_name); end
|
350
|
+
|
351
|
+
sig { returns(T.untyped) }
|
352
|
+
def build_width_calculator; end
|
353
|
+
|
354
|
+
sig { params(obj: T.untyped).returns(T.untyped) }
|
355
|
+
def extract_base_info(obj); end
|
356
|
+
|
357
|
+
sig { params(obj: T.untyped).returns(T.untyped) }
|
358
|
+
def extract_descriptor(obj); end
|
359
|
+
|
360
|
+
sig { params(obj: T.untyped).returns(T.untyped) }
|
361
|
+
def extract_descendants(obj); end
|
362
|
+
|
363
|
+
sig { params(params: T.untyped).returns(T.untyped) }
|
364
|
+
def to_utf8_via_cmap(params); end
|
365
|
+
|
366
|
+
sig { params(params: T.untyped).returns(T.untyped) }
|
367
|
+
def to_utf8_via_encoding(params); end
|
368
|
+
end
|
369
|
+
|
370
|
+
class FontDescriptor
|
371
|
+
sig { returns(T.untyped) }
|
372
|
+
attr_reader :font_name
|
373
|
+
|
374
|
+
sig { returns(T.untyped) }
|
375
|
+
attr_reader :font_family
|
376
|
+
|
377
|
+
sig { returns(T.untyped) }
|
378
|
+
attr_reader :font_stretch
|
379
|
+
|
380
|
+
sig { returns(T.untyped) }
|
381
|
+
attr_reader :font_weight
|
382
|
+
|
383
|
+
sig { returns(T.untyped) }
|
384
|
+
attr_reader :font_bounding_box
|
385
|
+
|
386
|
+
sig { returns(T.untyped) }
|
387
|
+
attr_reader :cap_height
|
388
|
+
|
389
|
+
sig { returns(T.untyped) }
|
390
|
+
attr_reader :ascent
|
391
|
+
|
392
|
+
sig { returns(T.untyped) }
|
393
|
+
attr_reader :descent
|
394
|
+
|
395
|
+
sig { returns(T.untyped) }
|
396
|
+
attr_reader :leading
|
397
|
+
|
398
|
+
sig { returns(T.untyped) }
|
399
|
+
attr_reader :avg_width
|
400
|
+
|
401
|
+
sig { returns(T.untyped) }
|
402
|
+
attr_reader :max_width
|
403
|
+
|
404
|
+
sig { returns(T.untyped) }
|
405
|
+
attr_reader :missing_width
|
406
|
+
|
407
|
+
sig { returns(T.untyped) }
|
408
|
+
attr_reader :italic_angle
|
409
|
+
|
410
|
+
sig { returns(T.untyped) }
|
411
|
+
attr_reader :stem_v
|
412
|
+
|
413
|
+
sig { returns(T.untyped) }
|
414
|
+
attr_reader :x_height
|
415
|
+
|
416
|
+
sig { returns(T.untyped) }
|
417
|
+
attr_reader :font_flags
|
418
|
+
|
419
|
+
sig { params(ohash: PDF::Reader::ObjectHash, fd_hash: T::Hash[T.untyped, T.untyped]).void }
|
420
|
+
def initialize(ohash, fd_hash); end
|
421
|
+
|
422
|
+
sig { params(char_code: T.untyped).returns(T.untyped) }
|
423
|
+
def glyph_width(char_code); end
|
424
|
+
|
425
|
+
sig { returns(T.untyped) }
|
426
|
+
def glyph_to_pdf_scale_factor; end
|
427
|
+
|
428
|
+
sig { returns(T.untyped) }
|
429
|
+
def ttf_program_stream; end
|
430
|
+
end
|
431
|
+
|
432
|
+
class FormXObject
|
433
|
+
include ResourceMethods
|
434
|
+
|
435
|
+
sig { returns(T.untyped) }
|
436
|
+
attr_reader :xobject
|
437
|
+
|
438
|
+
sig { params(page: T.untyped, xobject: T.untyped, options: T.untyped).void }
|
439
|
+
def initialize(page, xobject, options = {}); end
|
440
|
+
|
441
|
+
sig { returns(T.untyped) }
|
442
|
+
def font_objects; end
|
443
|
+
|
444
|
+
sig { params(receivers: T.untyped).returns(T.untyped) }
|
445
|
+
def walk(*receivers); end
|
446
|
+
|
447
|
+
sig { returns(T.untyped) }
|
448
|
+
def raw_content; end
|
449
|
+
|
450
|
+
sig { returns(T.untyped) }
|
451
|
+
def resources; end
|
452
|
+
|
453
|
+
sig { params(receivers: T.untyped, name: T.untyped, params: T.untyped).returns(T.untyped) }
|
454
|
+
def callback(receivers, name, params = []); end
|
455
|
+
|
456
|
+
sig { returns(T.untyped) }
|
457
|
+
def content_stream_md5; end
|
458
|
+
|
459
|
+
sig { returns(T.untyped) }
|
460
|
+
def cached_tokens_key; end
|
461
|
+
|
462
|
+
sig { returns(T.untyped) }
|
463
|
+
def tokens; end
|
464
|
+
|
465
|
+
sig { params(receivers: T.untyped, instructions: T.untyped).returns(T.untyped) }
|
466
|
+
def content_stream(receivers, instructions); end
|
467
|
+
end
|
468
|
+
|
469
|
+
class GlyphHash
|
470
|
+
sig { void }
|
471
|
+
def initialize; end
|
472
|
+
|
473
|
+
sig { params(name: T.untyped).returns(T.untyped) }
|
474
|
+
def name_to_unicode(name); end
|
475
|
+
|
476
|
+
sig { params(codepoint: T.untyped).returns(T.untyped) }
|
477
|
+
def unicode_to_name(codepoint); end
|
478
|
+
|
479
|
+
sig { returns(T.untyped) }
|
480
|
+
def load_adobe_glyph_mapping; end
|
481
|
+
end
|
482
|
+
|
483
|
+
class KeyBuilderV5
|
484
|
+
sig { params(opts: T::Hash[Symbol, String]).void }
|
485
|
+
def initialize(opts = {})
|
486
|
+
@key_length = T.let(T.unsafe(nil), Integer)
|
487
|
+
@owner_key = T.let(T.unsafe(nil), String)
|
488
|
+
@user_key = T.let(T.unsafe(nil), String)
|
489
|
+
@owner_encryption_key = T.let(T.unsafe(nil), String)
|
490
|
+
@user_encryption_key = T.let(T.unsafe(nil), String)
|
491
|
+
end
|
492
|
+
|
493
|
+
sig { params(pass: String).returns(String) }
|
494
|
+
def key(pass); end
|
495
|
+
|
496
|
+
sig { params(password: T.untyped).returns(T.untyped) }
|
497
|
+
def auth_owner_pass(password); end
|
498
|
+
|
499
|
+
sig { params(password: T.untyped).returns(T.untyped) }
|
500
|
+
def auth_user_pass(password); end
|
501
|
+
|
502
|
+
sig { params(password: String).returns(T.nilable(String)) }
|
503
|
+
def auth_owner_pass_r6(password); end
|
504
|
+
|
505
|
+
sig { params(password: String).returns(T.nilable(String)) }
|
506
|
+
def auth_user_pass_r6(password); end
|
507
|
+
|
508
|
+
sig { params(password: String, salt: String, user_key: String).returns(String)}
|
509
|
+
def r6_digest(password, salt, user_key = ''); end
|
510
|
+
|
511
|
+
sig { params(str: String).returns(Integer)}
|
512
|
+
def unpack_128bit_bigendian_int(str); end
|
513
|
+
end
|
514
|
+
|
515
|
+
class LZW
|
516
|
+
CODE_EOD = 257
|
517
|
+
CODE_CLEAR_TABLE = 256
|
518
|
+
|
519
|
+
class BitStream
|
520
|
+
sig { params(data: T.untyped, bits_in_chunk: T.untyped).void }
|
521
|
+
def initialize(data, bits_in_chunk); end
|
522
|
+
|
523
|
+
sig { params(bits_in_chunk: T.untyped).returns(T.untyped) }
|
524
|
+
def set_bits_in_chunk(bits_in_chunk); end
|
525
|
+
|
526
|
+
sig { returns(T.untyped) }
|
527
|
+
def read; end
|
528
|
+
end
|
529
|
+
|
530
|
+
class StringTable < Hash
|
531
|
+
sig { returns(T.untyped) }
|
532
|
+
attr_reader :string_table_pos
|
533
|
+
|
534
|
+
sig { void }
|
535
|
+
def initialize; end
|
536
|
+
|
537
|
+
sig { params(key: T.untyped).returns(T.untyped) }
|
538
|
+
def [](key); end
|
539
|
+
|
540
|
+
sig { params(string: T.untyped).returns(T.untyped) }
|
541
|
+
def add(string); end
|
542
|
+
end
|
543
|
+
|
544
|
+
sig { params(data: T.untyped).returns(T.untyped) }
|
545
|
+
def self.decode(data); end
|
546
|
+
|
547
|
+
sig { params(string_table: T.untyped, some_code: T.untyped, other_code: T.untyped).returns(T.untyped) }
|
548
|
+
def self.create_new_string(string_table, some_code, other_code); end
|
549
|
+
end
|
550
|
+
|
551
|
+
class NullSecurityHandler
|
552
|
+
sig { params(buf: T.untyped, _ref: T.untyped).returns(T.untyped) }
|
553
|
+
def decrypt(buf, _ref); end
|
554
|
+
end
|
555
|
+
|
556
|
+
class ObjectCache
|
557
|
+
CACHEABLE_TYPES = [:Catalog, :Page, :Pages]
|
558
|
+
|
559
|
+
sig { returns(T.untyped) }
|
560
|
+
attr_reader :hits
|
561
|
+
|
562
|
+
sig { returns(T.untyped) }
|
563
|
+
attr_reader :misses
|
564
|
+
|
565
|
+
sig { params(lru_size: T.untyped).void }
|
566
|
+
def initialize(lru_size = 1000); end
|
567
|
+
|
568
|
+
sig { params(key: T.untyped).returns(T.untyped) }
|
569
|
+
def [](key); end
|
570
|
+
|
571
|
+
sig { params(key: T.untyped, value: T.untyped).returns(T.untyped) }
|
572
|
+
def []=(key, value); end
|
573
|
+
|
574
|
+
sig { params(key: T.untyped, local_default: T.untyped).returns(T.untyped) }
|
575
|
+
def fetch(key, local_default = nil); end
|
576
|
+
|
577
|
+
sig { params(block: T.untyped).returns(T.untyped) }
|
578
|
+
def each(&block); end
|
579
|
+
|
580
|
+
sig { params(block: T.untyped).returns(T.untyped) }
|
581
|
+
def each_key(&block); end
|
582
|
+
|
583
|
+
sig { params(block: T.untyped).returns(T.untyped) }
|
584
|
+
def each_value(&block); end
|
585
|
+
|
586
|
+
sig { returns(T.untyped) }
|
587
|
+
def size; end
|
588
|
+
|
589
|
+
sig { returns(T.untyped) }
|
590
|
+
def empty?; end
|
591
|
+
|
592
|
+
sig { params(key: T.untyped).returns(T.untyped) }
|
593
|
+
def include?(key); end
|
594
|
+
|
595
|
+
sig { params(value: T.untyped).returns(T.untyped) }
|
596
|
+
def has_value?(value); end
|
597
|
+
|
598
|
+
sig { returns(T.untyped) }
|
599
|
+
def to_s; end
|
600
|
+
|
601
|
+
sig { returns(T.untyped) }
|
602
|
+
def keys; end
|
603
|
+
|
604
|
+
sig { returns(T.untyped) }
|
605
|
+
def values; end
|
606
|
+
|
607
|
+
sig { params(key: T.untyped).returns(T.untyped) }
|
608
|
+
def update_stats(key); end
|
609
|
+
|
610
|
+
sig { params(obj: T.untyped).returns(T.untyped) }
|
611
|
+
def cacheable?(obj); end
|
612
|
+
end
|
613
|
+
|
614
|
+
class ObjectHash
|
615
|
+
include Enumerable
|
616
|
+
|
617
|
+
sig { returns(T.untyped) }
|
618
|
+
attr_accessor :default
|
619
|
+
|
620
|
+
sig { returns(T.untyped) }
|
621
|
+
attr_reader :trailer
|
622
|
+
|
623
|
+
sig { returns(T.untyped) }
|
624
|
+
attr_reader :pdf_version
|
625
|
+
|
626
|
+
sig { returns(T.untyped) }
|
627
|
+
attr_reader :sec_handler
|
628
|
+
|
629
|
+
sig { params(input: T.untyped, opts: T.untyped).void }
|
630
|
+
def initialize(input, opts = {}); end
|
631
|
+
|
632
|
+
sig { params(ref: T.untyped).returns(T.untyped) }
|
633
|
+
def obj_type(ref); end
|
634
|
+
|
635
|
+
sig { params(ref: T.untyped).returns(T.untyped) }
|
636
|
+
def stream?(ref); end
|
637
|
+
|
638
|
+
sig { params(key: T.untyped).returns(T.untyped) }
|
639
|
+
def [](key); end
|
640
|
+
|
641
|
+
sig { params(key: T.untyped).returns(T.untyped) }
|
642
|
+
def object(key); end
|
643
|
+
|
644
|
+
sig { params(key: T.untyped).returns(T.nilable(T::Array[T.untyped])) }
|
645
|
+
def deref_array(key); end
|
646
|
+
|
647
|
+
sig { params(key: T.untyped).returns(T.nilable(T::Array[Numeric])) }
|
648
|
+
def deref_array_of_numbers(key); end
|
649
|
+
|
650
|
+
sig { params(key: T.untyped).returns(T.nilable(T:Hash[Symbol, T.untyped])) }
|
651
|
+
def deref_hash(key); end
|
652
|
+
|
653
|
+
sig { params(key: T.untyped).returns(T.nilable(Symbol)) }
|
654
|
+
def deref_name(key); end
|
655
|
+
|
656
|
+
sig { params(key: T.untyped).returns(T.any(Symbol, T::Array[T.untyped], NilClass)) }
|
657
|
+
def deref_name_or_array(key); end
|
658
|
+
|
659
|
+
sig { params(key: T.untyped).returns(T.nilable(Integer)) }
|
660
|
+
def deref_integer(key); end
|
661
|
+
|
662
|
+
sig { params(key: T.untyped).returns(T.nilable(Numeric)) }
|
663
|
+
def deref_number(key); end
|
664
|
+
|
665
|
+
sig { params(key: T.untyped).returns(T.nilable(PDF::Reader::Stream)) }
|
666
|
+
def deref_stream(key); end
|
667
|
+
|
668
|
+
sig { params(key: T.untyped).returns(T.nilable(String)) }
|
669
|
+
def deref_string(key); end
|
670
|
+
|
671
|
+
sig { params(key: T.untyped).returns(T.any(PDF::Reader::Stream, T::Array[T.untyped], NilClass)) }
|
672
|
+
def deref_stream_or_array(key); end
|
673
|
+
|
674
|
+
sig { params(key: T.untyped).returns(T.untyped) }
|
675
|
+
def deref!(key); end
|
676
|
+
|
677
|
+
sig { params(key: T.untyped).returns(T::Array[T.untyped]) }
|
678
|
+
def deref_array!(key); end
|
679
|
+
|
680
|
+
sig { params(key: T.untyped).returns(T::Hash[Symbol, T.untyped]) }
|
681
|
+
def deref_hash!(key); end
|
682
|
+
|
683
|
+
sig { params(key: T.untyped, local_default: T.untyped).returns(T.untyped) }
|
684
|
+
def fetch(key, local_default = nil); end
|
685
|
+
|
686
|
+
sig { params(block: T.untyped).returns(T.untyped) }
|
687
|
+
def each(&block); end
|
688
|
+
|
689
|
+
sig { params(block: T.untyped).returns(T.untyped) }
|
690
|
+
def each_key(&block); end
|
691
|
+
|
692
|
+
sig { params(block: T.untyped).returns(T.untyped) }
|
693
|
+
def each_value(&block); end
|
694
|
+
|
695
|
+
sig { returns(Integer) }
|
696
|
+
def size; end
|
697
|
+
|
698
|
+
sig { returns(T::Boolean) }
|
699
|
+
def empty?; end
|
700
|
+
|
701
|
+
sig { params(check_key: T.untyped).returns(T::Boolean) }
|
702
|
+
def has_key?(check_key); end
|
703
|
+
|
704
|
+
sig { params(value: T.untyped).returns(T::Boolean) }
|
705
|
+
def has_value?(value); end
|
706
|
+
|
707
|
+
sig { returns(String) }
|
708
|
+
def to_s; end
|
709
|
+
|
710
|
+
sig { returns(T::Array[PDF::Reader::Reference]) }
|
711
|
+
def keys; end
|
712
|
+
|
713
|
+
sig { returns(T.untyped) }
|
714
|
+
def values; end
|
715
|
+
|
716
|
+
sig { params(ids: T.untyped).returns(T.untyped) }
|
717
|
+
def values_at(*ids); end
|
718
|
+
|
719
|
+
sig { returns(T.untyped) }
|
720
|
+
def to_a; end
|
721
|
+
|
722
|
+
sig { returns(T::Array[PDF::Reader::Reference]) }
|
723
|
+
def page_references; end
|
724
|
+
|
725
|
+
sig { returns(T::Boolean) }
|
726
|
+
def encrypted?; end
|
727
|
+
|
728
|
+
sig { returns(T::Boolean) }
|
729
|
+
def sec_handler?; end
|
730
|
+
|
731
|
+
sig { params(key: T.untyped).returns(T.untyped) }
|
732
|
+
def fetch_object(key); end
|
733
|
+
|
734
|
+
sig { params(key: T.untyped).returns(T.untyped) }
|
735
|
+
def fetch_object_stream(key); end
|
736
|
+
|
737
|
+
sig { params(key: T.untyped, seen: T.untyped).returns(T.untyped) }
|
738
|
+
def deref_internal!(key, seen); end
|
739
|
+
|
740
|
+
sig { params(ref: T.untyped, obj: T.untyped).returns(T.untyped) }
|
741
|
+
def decrypt(ref, obj); end
|
742
|
+
|
743
|
+
sig { params(offset: Integer).returns(PDF::Reader::Buffer) }
|
744
|
+
def new_buffer(offset = 0); end
|
745
|
+
|
746
|
+
sig { returns(T.untyped) }
|
747
|
+
def xref; end
|
748
|
+
|
749
|
+
sig { returns(T.untyped) }
|
750
|
+
def object_streams; end
|
751
|
+
|
752
|
+
sig { params(obj: T::Hash[T.untyped, T.untyped]).returns(T::Array[T::Hash[T.untyped, T.untyped]]) }
|
753
|
+
def get_page_objects(obj); end
|
754
|
+
|
755
|
+
sig { returns(Float) }
|
756
|
+
def read_version; end
|
757
|
+
|
758
|
+
sig { params(input: T.untyped).returns(IO) }
|
759
|
+
def extract_io_from(input); end
|
760
|
+
|
761
|
+
sig { params(input: T.untyped).returns(T.untyped) }
|
762
|
+
def read_as_binary(input); end
|
763
|
+
end
|
764
|
+
|
765
|
+
class ObjectStream
|
766
|
+
sig { params(stream: T.untyped).void }
|
767
|
+
def initialize(stream); end
|
768
|
+
|
769
|
+
sig { params(objid: T.untyped).returns(T.untyped) }
|
770
|
+
def [](objid); end
|
771
|
+
|
772
|
+
sig { returns(T.untyped) }
|
773
|
+
def size; end
|
774
|
+
|
775
|
+
sig { returns(T.untyped) }
|
776
|
+
def offsets; end
|
777
|
+
|
778
|
+
sig { returns(T.untyped) }
|
779
|
+
def first; end
|
780
|
+
|
781
|
+
sig { returns(T.untyped) }
|
782
|
+
def buffer; end
|
783
|
+
end
|
784
|
+
|
785
|
+
class OverlappingRunsFilter
|
786
|
+
OVERLAPPING_THRESHOLD = 0.5
|
787
|
+
|
788
|
+
sig { params(runs: T::Array[PDF::Reader::TextRun]).returns(T::Array[PDF::Reader::TextRun]) }
|
789
|
+
def self.exclude_redundant_runs(runs); end
|
790
|
+
|
791
|
+
sig { params(sweep_line_status: T::Array[PDF::Reader::TextRun], event_point: EventPoint).returns(T::Boolean) }
|
792
|
+
def self.detect_intersection(sweep_line_status, event_point); end
|
793
|
+
end
|
794
|
+
|
795
|
+
class EventPoint
|
796
|
+
sig { returns(Numeric) }
|
797
|
+
attr_reader :x
|
798
|
+
|
799
|
+
sig { returns(PDF::Reader::TextRun) }
|
800
|
+
attr_reader :run
|
801
|
+
|
802
|
+
sig { params(x: Numeric, run: PDF::Reader::TextRun).void }
|
803
|
+
def initialize(x, run); end
|
804
|
+
|
805
|
+
sig { returns(T::Boolean) }
|
806
|
+
def start?; end
|
807
|
+
end
|
808
|
+
|
809
|
+
class Page
|
810
|
+
include ResourceMethods
|
811
|
+
|
812
|
+
sig { returns(PDF::Reader::ObjectHash) }
|
813
|
+
attr_reader :objects
|
814
|
+
|
815
|
+
sig { returns(T.untyped) }
|
816
|
+
attr_reader :page_object
|
817
|
+
|
818
|
+
sig { returns(T.untyped) }
|
819
|
+
attr_reader :cache
|
820
|
+
|
821
|
+
sig { params(objects: PDF::Reader::ObjectHash, pagenum: Integer, options: T::Hash[Symbol, T.untyped]).void }
|
822
|
+
def initialize(objects, pagenum, options = {}); end
|
823
|
+
|
824
|
+
sig { returns(Integer) }
|
825
|
+
def number; end
|
826
|
+
|
827
|
+
sig { returns(String) }
|
828
|
+
def inspect; end
|
829
|
+
|
830
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
831
|
+
def attributes; end
|
832
|
+
|
833
|
+
sig { returns(Numeric) }
|
834
|
+
def height; end
|
835
|
+
|
836
|
+
sig { returns(Numeric) }
|
837
|
+
def width; end
|
838
|
+
|
839
|
+
sig { returns(String) }
|
840
|
+
def orientation; end
|
841
|
+
|
842
|
+
sig { returns(T::Array[Numeric]) }
|
843
|
+
def origin; end
|
844
|
+
|
845
|
+
sig { params(opts: T::Hash[Symbol, T.untyped]).returns(T::Array[PDF::Reader::TextRun]) }
|
846
|
+
def runs(opts = {}); end
|
847
|
+
|
848
|
+
sig { params(opts: T::Hash[Symbol, T.untyped]).returns(String) }
|
849
|
+
def text(opts = {}); end
|
850
|
+
|
851
|
+
sig { params(receivers: T.untyped).void }
|
852
|
+
def walk(*receivers); end
|
853
|
+
|
854
|
+
sig { returns(String) }
|
855
|
+
def raw_content; end
|
856
|
+
|
857
|
+
sig { returns(Integer) }
|
858
|
+
def rotate; end
|
859
|
+
|
860
|
+
sig { returns(T::Hash[Symbol, T::Array[Numeric]]) }
|
861
|
+
def boxes; end
|
862
|
+
|
863
|
+
sig { returns(T::Hash[Symbol, PDF::Reader::Rectangle]) }
|
864
|
+
def rectangles; end
|
865
|
+
|
866
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
867
|
+
def root; end
|
868
|
+
|
869
|
+
sig { returns(PDF::Reader::Resources) }
|
870
|
+
def resources; end
|
871
|
+
|
872
|
+
sig { params(receivers: T.untyped, instructions: T.untyped).returns(T.untyped) }
|
873
|
+
def content_stream(receivers, instructions); end
|
874
|
+
|
875
|
+
sig { params(receivers: T.untyped, name: T.untyped, params: T.untyped).returns(T.untyped) }
|
876
|
+
def callback(receivers, name, params = []); end
|
877
|
+
|
878
|
+
sig { returns(T.untyped) }
|
879
|
+
def page_with_ancestors; end
|
880
|
+
|
881
|
+
sig { params(origin: T.untyped).returns(T.untyped) }
|
882
|
+
def ancestors(origin = @page_object[:Parent]); end
|
883
|
+
|
884
|
+
sig { params(obj: T::Hash[T.untyped, T.untyped]).returns(T::Hash[Symbol, T.untyped]) }
|
885
|
+
def select_inheritable(obj); end
|
886
|
+
end
|
887
|
+
|
888
|
+
class PageLayout
|
889
|
+
DEFAULT_FONT_SIZE = 12
|
890
|
+
|
891
|
+
sig { params(runs: T::Array[PDF::Reader::TextRun], mediabox: T.any(T::Array[Numeric], PDF::Reader::Rectangle)).void }
|
892
|
+
def initialize(runs, mediabox); end
|
893
|
+
|
894
|
+
sig { returns(String) }
|
895
|
+
def to_s; end
|
896
|
+
|
897
|
+
sig { params(rows: T.untyped).returns(T.untyped) }
|
898
|
+
def interesting_rows(rows); end
|
899
|
+
|
900
|
+
sig { returns(T.untyped) }
|
901
|
+
def row_count; end
|
902
|
+
|
903
|
+
sig { returns(T.untyped) }
|
904
|
+
def col_count; end
|
905
|
+
|
906
|
+
sig { returns(T.untyped) }
|
907
|
+
def row_multiplier; end
|
908
|
+
|
909
|
+
sig { returns(T.untyped) }
|
910
|
+
def col_multiplier; end
|
911
|
+
|
912
|
+
sig { params(collection: T.untyped).returns(T.untyped) }
|
913
|
+
def mean(collection); end
|
914
|
+
|
915
|
+
sig { params(collection: T.untyped).returns(T.untyped) }
|
916
|
+
def median(collection); end
|
917
|
+
|
918
|
+
sig { params(runs: T.untyped).returns(T.untyped) }
|
919
|
+
def merge_runs(runs); end
|
920
|
+
|
921
|
+
sig { params(chars: T::Array[PDF::Reader::TextRun]).returns(T::Array[PDF::Reader::TextRun]) }
|
922
|
+
def group_chars_into_runs(chars); end
|
923
|
+
|
924
|
+
sig { params(haystack: T.untyped, needle: T.untyped, index: T.untyped).returns(T.untyped) }
|
925
|
+
def local_string_insert(haystack, needle, index); end
|
926
|
+
|
927
|
+
sig { params(mediabox: T.untyped).returns(T.untyped) }
|
928
|
+
def process_mediabox(mediabox); end
|
929
|
+
end
|
930
|
+
|
931
|
+
class PageState
|
932
|
+
DEFAULT_GRAPHICS_STATE = {
|
933
|
+
:char_spacing => 0,
|
934
|
+
:word_spacing => 0,
|
935
|
+
:h_scaling => 1.0,
|
936
|
+
:text_leading => 0,
|
937
|
+
:text_font => nil,
|
938
|
+
:text_font_size => nil,
|
939
|
+
:text_mode => 0,
|
940
|
+
:text_rise => 0,
|
941
|
+
:text_knockout => 0
|
942
|
+
}
|
943
|
+
|
944
|
+
sig { params(page: T.untyped).void }
|
945
|
+
def initialize(page); end
|
946
|
+
|
947
|
+
sig { returns(T.untyped) }
|
948
|
+
def save_graphics_state; end
|
949
|
+
|
950
|
+
sig { returns(T.untyped) }
|
951
|
+
def restore_graphics_state; end
|
952
|
+
|
953
|
+
sig do
|
954
|
+
params(
|
955
|
+
a: T.untyped,
|
956
|
+
b: T.untyped,
|
957
|
+
c: T.untyped,
|
958
|
+
d: T.untyped,
|
959
|
+
e: T.untyped,
|
960
|
+
f: T.untyped
|
961
|
+
).returns(T.untyped)
|
962
|
+
end
|
963
|
+
def concatenate_matrix(a, b, c, d, e, f); end
|
964
|
+
|
965
|
+
sig { returns(T.untyped) }
|
966
|
+
def begin_text_object; end
|
967
|
+
|
968
|
+
sig { returns(T.untyped) }
|
969
|
+
def end_text_object; end
|
970
|
+
|
971
|
+
sig { params(char_spacing: T.untyped).returns(T.untyped) }
|
972
|
+
def set_character_spacing(char_spacing); end
|
973
|
+
|
974
|
+
sig { params(h_scaling: T.untyped).returns(T.untyped) }
|
975
|
+
def set_horizontal_text_scaling(h_scaling); end
|
976
|
+
|
977
|
+
sig { params(label: T.untyped, size: T.untyped).returns(T.untyped) }
|
978
|
+
def set_text_font_and_size(label, size); end
|
979
|
+
|
980
|
+
sig { returns(T.untyped) }
|
981
|
+
def font_size; end
|
982
|
+
|
983
|
+
sig { params(leading: T.untyped).returns(T.untyped) }
|
984
|
+
def set_text_leading(leading); end
|
985
|
+
|
986
|
+
sig { params(mode: T.untyped).returns(T.untyped) }
|
987
|
+
def set_text_rendering_mode(mode); end
|
988
|
+
|
989
|
+
sig { params(rise: T.untyped).returns(T.untyped) }
|
990
|
+
def set_text_rise(rise); end
|
991
|
+
|
992
|
+
sig { params(word_spacing: T.untyped).returns(T.untyped) }
|
993
|
+
def set_word_spacing(word_spacing); end
|
994
|
+
|
995
|
+
sig { params(x: T.untyped, y: T.untyped).returns(T.untyped) }
|
996
|
+
def move_text_position(x, y); end
|
997
|
+
|
998
|
+
sig { params(x: T.untyped, y: T.untyped).returns(T.untyped) }
|
999
|
+
def move_text_position_and_set_leading(x, y); end
|
1000
|
+
|
1001
|
+
sig do
|
1002
|
+
params(
|
1003
|
+
a: T.untyped,
|
1004
|
+
b: T.untyped,
|
1005
|
+
c: T.untyped,
|
1006
|
+
d: T.untyped,
|
1007
|
+
e: T.untyped,
|
1008
|
+
f: T.untyped
|
1009
|
+
).returns(T.untyped)
|
1010
|
+
end
|
1011
|
+
def set_text_matrix_and_text_line_matrix(a, b, c, d, e, f); end
|
1012
|
+
|
1013
|
+
sig { returns(T.untyped) }
|
1014
|
+
def move_to_start_of_next_line; end
|
1015
|
+
|
1016
|
+
sig { params(params: T.untyped).returns(T.untyped) }
|
1017
|
+
def show_text_with_positioning(params); end
|
1018
|
+
|
1019
|
+
sig { params(str: T.untyped).returns(T.untyped) }
|
1020
|
+
def move_to_next_line_and_show_text(str); end
|
1021
|
+
|
1022
|
+
sig { params(aw: T.untyped, ac: T.untyped, string: T.untyped).returns(T.untyped) }
|
1023
|
+
def set_spacing_next_line_show_text(aw, ac, string); end
|
1024
|
+
|
1025
|
+
sig { params(label: T.untyped).returns(T.untyped) }
|
1026
|
+
def invoke_xobject(label); end
|
1027
|
+
|
1028
|
+
sig { params(x: T.untyped, y: T.untyped).returns(T.untyped) }
|
1029
|
+
def ctm_transform(x, y); end
|
1030
|
+
|
1031
|
+
sig { params(x: T.untyped, y: T.untyped).returns(T.untyped) }
|
1032
|
+
def trm_transform(x, y); end
|
1033
|
+
|
1034
|
+
sig { returns(T.untyped) }
|
1035
|
+
def current_font; end
|
1036
|
+
|
1037
|
+
sig { params(label: T.untyped).returns(T.untyped) }
|
1038
|
+
def find_font(label); end
|
1039
|
+
|
1040
|
+
sig { params(label: T.untyped).returns(T.untyped) }
|
1041
|
+
def find_color_space(label); end
|
1042
|
+
|
1043
|
+
sig { params(label: T.untyped).returns(T.untyped) }
|
1044
|
+
def find_xobject(label); end
|
1045
|
+
|
1046
|
+
sig { returns(T.untyped) }
|
1047
|
+
def stack_depth; end
|
1048
|
+
|
1049
|
+
sig { returns(T.untyped) }
|
1050
|
+
def clone_state; end
|
1051
|
+
|
1052
|
+
sig { params(w0: T.untyped, tj: T.untyped, word_boundary: T.untyped).returns(T.untyped) }
|
1053
|
+
def process_glyph_displacement(w0, tj, word_boundary); end
|
1054
|
+
|
1055
|
+
sig { returns(T.untyped) }
|
1056
|
+
def text_rendering_matrix; end
|
1057
|
+
|
1058
|
+
sig { returns(T.untyped) }
|
1059
|
+
def ctm; end
|
1060
|
+
|
1061
|
+
sig { returns(T.untyped) }
|
1062
|
+
def state; end
|
1063
|
+
|
1064
|
+
sig { params(raw_fonts: T.untyped).returns(T.untyped) }
|
1065
|
+
def build_fonts(raw_fonts); end
|
1066
|
+
|
1067
|
+
sig { returns(T.untyped) }
|
1068
|
+
def identity_matrix; end
|
1069
|
+
end
|
1070
|
+
|
1071
|
+
class PageTextReceiver
|
1072
|
+
extend Forwardable
|
1073
|
+
SPACE = " "
|
1074
|
+
|
1075
|
+
sig { returns(T.untyped) }
|
1076
|
+
attr_reader :state
|
1077
|
+
|
1078
|
+
sig { returns(T.untyped) }
|
1079
|
+
attr_reader :options
|
1080
|
+
|
1081
|
+
sig { params(page: T.untyped).returns(T.untyped) }
|
1082
|
+
def page=(page); end
|
1083
|
+
|
1084
|
+
sig { returns(T.untyped) }
|
1085
|
+
def content; end
|
1086
|
+
|
1087
|
+
sig { params(string: String).void }
|
1088
|
+
def show_text(string); end
|
1089
|
+
|
1090
|
+
sig { params(params: T::Array[T.untyped]).void }
|
1091
|
+
def show_text_with_positioning(params); end
|
1092
|
+
|
1093
|
+
sig { params(str: String).void }
|
1094
|
+
def move_to_next_line_and_show_text(str); end
|
1095
|
+
|
1096
|
+
sig { params(opts: T::Hash[Symbol, T.untyped]).returns(T::Array[PDF::Reader::TextRun]) }
|
1097
|
+
def runs(opts = {}); end
|
1098
|
+
|
1099
|
+
sig { params(aw: Numeric, ac: Numeric, string: String).void }
|
1100
|
+
def set_spacing_next_line_show_text(aw, ac, string); end
|
1101
|
+
|
1102
|
+
sig { params(label: T.untyped).returns(T.untyped) }
|
1103
|
+
def invoke_xobject(label); end
|
1104
|
+
|
1105
|
+
sig { params(string: String).void }
|
1106
|
+
def internal_show_text(string); end
|
1107
|
+
|
1108
|
+
sig { params(x: T.untyped, y: T.untyped).returns(T.untyped) }
|
1109
|
+
def apply_rotation(x, y); end
|
1110
|
+
end
|
1111
|
+
|
1112
|
+
class PagesStrategy
|
1113
|
+
OPERATORS = {
|
1114
|
+
'b' => :close_fill_stroke,
|
1115
|
+
'B' => :fill_stroke,
|
1116
|
+
'b*' => :close_fill_stroke_with_even_odd,
|
1117
|
+
'B*' => :fill_stroke_with_even_odd,
|
1118
|
+
'BDC' => :begin_marked_content_with_pl,
|
1119
|
+
'BI' => :begin_inline_image,
|
1120
|
+
'BMC' => :begin_marked_content,
|
1121
|
+
'BT' => :begin_text_object,
|
1122
|
+
'BX' => :begin_compatibility_section,
|
1123
|
+
'c' => :append_curved_segment,
|
1124
|
+
'cm' => :concatenate_matrix,
|
1125
|
+
'CS' => :set_stroke_color_space,
|
1126
|
+
'cs' => :set_nonstroke_color_space,
|
1127
|
+
'd' => :set_line_dash,
|
1128
|
+
'd0' => :set_glyph_width,
|
1129
|
+
'd1' => :set_glyph_width_and_bounding_box,
|
1130
|
+
'Do' => :invoke_xobject,
|
1131
|
+
'DP' => :define_marked_content_with_pl,
|
1132
|
+
'EI' => :end_inline_image,
|
1133
|
+
'EMC' => :end_marked_content,
|
1134
|
+
'ET' => :end_text_object,
|
1135
|
+
'EX' => :end_compatibility_section,
|
1136
|
+
'f' => :fill_path_with_nonzero,
|
1137
|
+
'F' => :fill_path_with_nonzero,
|
1138
|
+
'f*' => :fill_path_with_even_odd,
|
1139
|
+
'G' => :set_gray_for_stroking,
|
1140
|
+
'g' => :set_gray_for_nonstroking,
|
1141
|
+
'gs' => :set_graphics_state_parameters,
|
1142
|
+
'h' => :close_subpath,
|
1143
|
+
'i' => :set_flatness_tolerance,
|
1144
|
+
'ID' => :begin_inline_image_data,
|
1145
|
+
'j' => :set_line_join_style,
|
1146
|
+
'J' => :set_line_cap_style,
|
1147
|
+
'K' => :set_cmyk_color_for_stroking,
|
1148
|
+
'k' => :set_cmyk_color_for_nonstroking,
|
1149
|
+
'l' => :append_line,
|
1150
|
+
'm' => :begin_new_subpath,
|
1151
|
+
'M' => :set_miter_limit,
|
1152
|
+
'MP' => :define_marked_content_point,
|
1153
|
+
'n' => :end_path,
|
1154
|
+
'q' => :save_graphics_state,
|
1155
|
+
'Q' => :restore_graphics_state,
|
1156
|
+
're' => :append_rectangle,
|
1157
|
+
'RG' => :set_rgb_color_for_stroking,
|
1158
|
+
'rg' => :set_rgb_color_for_nonstroking,
|
1159
|
+
'ri' => :set_color_rendering_intent,
|
1160
|
+
's' => :close_and_stroke_path,
|
1161
|
+
'S' => :stroke_path,
|
1162
|
+
'SC' => :set_color_for_stroking,
|
1163
|
+
'sc' => :set_color_for_nonstroking,
|
1164
|
+
'SCN' => :set_color_for_stroking_and_special,
|
1165
|
+
'scn' => :set_color_for_nonstroking_and_special,
|
1166
|
+
'sh' => :paint_area_with_shading_pattern,
|
1167
|
+
'T*' => :move_to_start_of_next_line,
|
1168
|
+
'Tc' => :set_character_spacing,
|
1169
|
+
'Td' => :move_text_position,
|
1170
|
+
'TD' => :move_text_position_and_set_leading,
|
1171
|
+
'Tf' => :set_text_font_and_size,
|
1172
|
+
'Tj' => :show_text,
|
1173
|
+
'TJ' => :show_text_with_positioning,
|
1174
|
+
'TL' => :set_text_leading,
|
1175
|
+
'Tm' => :set_text_matrix_and_text_line_matrix,
|
1176
|
+
'Tr' => :set_text_rendering_mode,
|
1177
|
+
'Ts' => :set_text_rise,
|
1178
|
+
'Tw' => :set_word_spacing,
|
1179
|
+
'Tz' => :set_horizontal_text_scaling,
|
1180
|
+
'v' => :append_curved_segment_initial_point_replicated,
|
1181
|
+
'w' => :set_line_width,
|
1182
|
+
'W' => :set_clipping_path_with_nonzero,
|
1183
|
+
'W*' => :set_clipping_path_with_even_odd,
|
1184
|
+
'y' => :append_curved_segment_final_point_replicated,
|
1185
|
+
'\'' => :move_to_next_line_and_show_text,
|
1186
|
+
'"' => :set_spacing_next_line_show_text,
|
1187
|
+
}
|
1188
|
+
end
|
1189
|
+
|
1190
|
+
class Parser
|
1191
|
+
sig { params(buffer: PDF::Reader::Buffer, objects: T.nilable(PDF::Reader::ObjectHash)).void }
|
1192
|
+
def initialize(buffer, objects=nil); end
|
1193
|
+
|
1194
|
+
sig {
|
1195
|
+
params(
|
1196
|
+
operators: T::Hash[T.any(String, PDF::Reader::Token), Symbol]
|
1197
|
+
).returns(
|
1198
|
+
T.any(PDF::Reader::Reference, PDF::Reader::Token, Numeric, String, Symbol, T::Array[T.untyped], T::Hash[T.untyped, T.untyped], NilClass)
|
1199
|
+
)
|
1200
|
+
}
|
1201
|
+
def parse_token(operators={}); end
|
1202
|
+
|
1203
|
+
sig {
|
1204
|
+
params(
|
1205
|
+
id: Integer,
|
1206
|
+
gen: Integer
|
1207
|
+
).returns(
|
1208
|
+
T.any(PDF::Reader::Reference, PDF::Reader::Token, PDF::Reader::Stream, Numeric, String, Symbol, T::Array[T.untyped], T::Hash[T.untyped, T.untyped], NilClass)
|
1209
|
+
)
|
1210
|
+
}
|
1211
|
+
def object(id, gen); end
|
1212
|
+
|
1213
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
1214
|
+
def dictionary; end
|
1215
|
+
|
1216
|
+
sig { returns(Symbol) }
|
1217
|
+
def pdf_name; end
|
1218
|
+
|
1219
|
+
sig { returns(T::Array[T.untyped]) }
|
1220
|
+
def array; end
|
1221
|
+
|
1222
|
+
sig { returns(String) }
|
1223
|
+
def hex_string; end
|
1224
|
+
|
1225
|
+
sig { returns(String) }
|
1226
|
+
def string; end
|
1227
|
+
|
1228
|
+
sig { params(dict: T::Hash[Symbol, T.untyped]).returns(PDF::Reader::Stream) }
|
1229
|
+
def stream(dict); end
|
1230
|
+
end
|
1231
|
+
|
1232
|
+
class Point
|
1233
|
+
sig do
|
1234
|
+
params(
|
1235
|
+
x: Numeric,
|
1236
|
+
y: Numeric,
|
1237
|
+
).void
|
1238
|
+
end
|
1239
|
+
def initialize(x, y)
|
1240
|
+
@x = T.let(T.unsafe(nil), Numeric)
|
1241
|
+
@y = T.let(T.unsafe(nil), Numeric)
|
1242
|
+
end
|
1243
|
+
|
1244
|
+
sig { returns(Numeric) }
|
1245
|
+
def x; end
|
1246
|
+
|
1247
|
+
sig { returns(Numeric) }
|
1248
|
+
def y; end
|
1249
|
+
|
1250
|
+
sig { params(other: PDF::Reader::Point).returns(T::Boolean) }
|
1251
|
+
def ==(other); end
|
1252
|
+
|
1253
|
+
end
|
1254
|
+
|
1255
|
+
class PrintReceiver
|
1256
|
+
sig { returns(T.untyped) }
|
1257
|
+
attr_accessor :callbacks
|
1258
|
+
|
1259
|
+
sig { void }
|
1260
|
+
def initialize; end
|
1261
|
+
|
1262
|
+
sig { params(meth: T.untyped).returns(T.untyped) }
|
1263
|
+
def respond_to?(meth); end
|
1264
|
+
|
1265
|
+
sig { params(methodname: T.untyped, args: T.untyped).returns(T.untyped) }
|
1266
|
+
def method_missing(methodname, *args); end
|
1267
|
+
end
|
1268
|
+
|
1269
|
+
class Rc4SecurityHandler
|
1270
|
+
sig { params(key: String).void }
|
1271
|
+
def initialize(key)
|
1272
|
+
@encrypt_key = T.let(T.unsafe(nil), String)
|
1273
|
+
end
|
1274
|
+
|
1275
|
+
sig { params(buf: T.untyped, ref: T.untyped).returns(T.untyped) }
|
1276
|
+
def decrypt(buf, ref); end
|
1277
|
+
end
|
1278
|
+
|
1279
|
+
class Rectangle
|
1280
|
+
|
1281
|
+
sig { params(arr: T::Array[Numeric]).returns(PDF::Reader::Rectangle) }
|
1282
|
+
def self.from_array(arr); end
|
1283
|
+
|
1284
|
+
sig do
|
1285
|
+
params(
|
1286
|
+
x1: Numeric,
|
1287
|
+
y1: Numeric,
|
1288
|
+
x2: Numeric,
|
1289
|
+
y2: Numeric
|
1290
|
+
).void
|
1291
|
+
end
|
1292
|
+
|
1293
|
+
def initialize(x1, y1, x2, y2)
|
1294
|
+
@bottom_left = T.let(T.unsafe(nil), PDF::Reader::Point)
|
1295
|
+
@bottom_right = T.let(T.unsafe(nil), PDF::Reader::Point)
|
1296
|
+
@top_left = T.let(T.unsafe(nil), PDF::Reader::Point)
|
1297
|
+
@top_right = T.let(T.unsafe(nil), PDF::Reader::Point)
|
1298
|
+
end
|
1299
|
+
|
1300
|
+
sig { returns(PDF::Reader::Point) }
|
1301
|
+
def bottom_left; end
|
1302
|
+
|
1303
|
+
sig { returns(PDF::Reader::Point) }
|
1304
|
+
def bottom_right; end
|
1305
|
+
|
1306
|
+
sig { returns(PDF::Reader::Point) }
|
1307
|
+
def top_left; end
|
1308
|
+
|
1309
|
+
sig { returns(PDF::Reader::Point) }
|
1310
|
+
def top_right; end
|
1311
|
+
|
1312
|
+
sig { returns(Numeric) }
|
1313
|
+
def height; end
|
1314
|
+
|
1315
|
+
sig { returns(Numeric) }
|
1316
|
+
def width; end
|
1317
|
+
|
1318
|
+
sig { returns(T::Array[Numeric]) }
|
1319
|
+
def to_a; end
|
1320
|
+
|
1321
|
+
sig { params(degrees: Integer).void }
|
1322
|
+
def apply_rotation(degrees); end
|
1323
|
+
|
1324
|
+
sig { params(point: PDF::Reader::Point).void }
|
1325
|
+
def contains?(point); end
|
1326
|
+
|
1327
|
+
sig { params(other: PDF::Reader::Rectangle).void }
|
1328
|
+
def ==(other); end
|
1329
|
+
|
1330
|
+
sig { params(x1: Numeric, y1: Numeric, x2: Numeric, y2: Numeric).void }
|
1331
|
+
def set_corners(x1, y1, x2, y2); end
|
1332
|
+
end
|
1333
|
+
|
1334
|
+
class Reference
|
1335
|
+
sig { returns(T.untyped) }
|
1336
|
+
attr_reader :id
|
1337
|
+
|
1338
|
+
sig { returns(T.untyped) }
|
1339
|
+
attr_reader :gen
|
1340
|
+
|
1341
|
+
sig { params(id: T.untyped, gen: T.untyped).void }
|
1342
|
+
def initialize(id, gen); end
|
1343
|
+
|
1344
|
+
sig { returns(T.untyped) }
|
1345
|
+
def to_a; end
|
1346
|
+
|
1347
|
+
sig { returns(T.untyped) }
|
1348
|
+
def to_i; end
|
1349
|
+
|
1350
|
+
sig { params(obj: T.untyped).returns(T.untyped) }
|
1351
|
+
def ==(obj); end
|
1352
|
+
|
1353
|
+
sig { returns(T.untyped) }
|
1354
|
+
def hash; end
|
1355
|
+
end
|
1356
|
+
|
1357
|
+
class RegisterReceiver
|
1358
|
+
sig { returns(T.untyped) }
|
1359
|
+
attr_accessor :callbacks
|
1360
|
+
|
1361
|
+
sig { void }
|
1362
|
+
def initialize; end
|
1363
|
+
|
1364
|
+
sig { params(meth: T.untyped).returns(T.untyped) }
|
1365
|
+
def respond_to?(meth); end
|
1366
|
+
|
1367
|
+
sig { params(methodname: T.untyped, args: T.untyped).returns(T.untyped) }
|
1368
|
+
def method_missing(methodname, *args); end
|
1369
|
+
|
1370
|
+
sig { params(methodname: T.untyped).returns(T.untyped) }
|
1371
|
+
def count(methodname); end
|
1372
|
+
|
1373
|
+
sig { params(methodname: T.untyped).returns(T.untyped) }
|
1374
|
+
def all(methodname); end
|
1375
|
+
|
1376
|
+
sig { params(methodname: T.untyped).returns(T.untyped) }
|
1377
|
+
def all_args(methodname); end
|
1378
|
+
|
1379
|
+
sig { params(methodname: T.untyped).returns(T.untyped) }
|
1380
|
+
def first_occurance_of(methodname); end
|
1381
|
+
|
1382
|
+
sig { params(methodname: T.untyped).returns(T.untyped) }
|
1383
|
+
def final_occurance_of(methodname); end
|
1384
|
+
|
1385
|
+
sig { params(methods: T.untyped).returns(T.untyped) }
|
1386
|
+
def series(*methods); end
|
1387
|
+
end
|
1388
|
+
|
1389
|
+
module ResourceMethods
|
1390
|
+
extend T::Helpers
|
1391
|
+
|
1392
|
+
sig { returns(T.untyped) }
|
1393
|
+
def color_spaces; end
|
1394
|
+
|
1395
|
+
sig { returns(T::Hash[T.untyped, T.untyped]) }
|
1396
|
+
def fonts; end
|
1397
|
+
|
1398
|
+
sig { returns(T.untyped) }
|
1399
|
+
def graphic_states; end
|
1400
|
+
|
1401
|
+
sig { returns(T.untyped) }
|
1402
|
+
def patterns; end
|
1403
|
+
|
1404
|
+
sig { returns(T.untyped) }
|
1405
|
+
def procedure_sets; end
|
1406
|
+
|
1407
|
+
sig { returns(T.untyped) }
|
1408
|
+
def properties; end
|
1409
|
+
|
1410
|
+
sig { returns(T.untyped) }
|
1411
|
+
def shadings; end
|
1412
|
+
|
1413
|
+
sig { returns(T.untyped) }
|
1414
|
+
def xobjects; end
|
1415
|
+
end
|
1416
|
+
|
1417
|
+
class SecurityHandlerFactory
|
1418
|
+
sig { params(encrypt: T.untyped, doc_id: T.untyped, password: T.untyped).returns(T.untyped) }
|
1419
|
+
def self.build(encrypt, doc_id, password); end
|
1420
|
+
|
1421
|
+
sig { params(encrypt: T.untyped, doc_id: T.untyped, password: T.untyped).returns(T.untyped) }
|
1422
|
+
def self.build_standard_handler(encrypt, doc_id, password); end
|
1423
|
+
|
1424
|
+
sig { params(encrypt: T.untyped, doc_id: T.untyped, password: T.untyped).returns(T.untyped) }
|
1425
|
+
def self.build_v5_handler(encrypt, doc_id, password); end
|
1426
|
+
|
1427
|
+
sig { params(encrypt: T.untyped).returns(T.untyped) }
|
1428
|
+
def self.standard?(encrypt); end
|
1429
|
+
|
1430
|
+
sig { params(encrypt: T.untyped).returns(T.untyped) }
|
1431
|
+
def self.standard_v5?(encrypt); end
|
1432
|
+
end
|
1433
|
+
|
1434
|
+
class StandardKeyBuilder
|
1435
|
+
PassPadBytes = [ 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41,
|
1436
|
+
0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08,
|
1437
|
+
0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80,
|
1438
|
+
0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a ]
|
1439
|
+
|
1440
|
+
sig { params(opts: T::Hash[Symbol, T.untyped]).void }
|
1441
|
+
def initialize(opts = {}); end
|
1442
|
+
|
1443
|
+
sig { params(pass: String).returns(String) }
|
1444
|
+
def key(pass); end
|
1445
|
+
|
1446
|
+
sig { params(p: T.untyped).returns(T.untyped) }
|
1447
|
+
def pad_pass(p = ""); end
|
1448
|
+
|
1449
|
+
sig { params(buf: T.untyped, int: T.untyped).returns(T.untyped) }
|
1450
|
+
def xor_each_byte(buf, int); end
|
1451
|
+
|
1452
|
+
sig { params(pass: T.untyped).returns(T.untyped) }
|
1453
|
+
def auth_owner_pass(pass); end
|
1454
|
+
|
1455
|
+
sig { params(pass: T.untyped).returns(T.untyped) }
|
1456
|
+
def auth_user_pass(pass); end
|
1457
|
+
|
1458
|
+
sig { params(user_pass: T.untyped).returns(T.untyped) }
|
1459
|
+
def make_file_key(user_pass); end
|
1460
|
+
end
|
1461
|
+
|
1462
|
+
class Stream
|
1463
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
1464
|
+
attr_accessor :hash
|
1465
|
+
|
1466
|
+
sig { returns(String) }
|
1467
|
+
attr_accessor :data
|
1468
|
+
|
1469
|
+
sig { params(hash: T::Hash[Symbol, T.untyped], data: String).void }
|
1470
|
+
def initialize(hash, data)
|
1471
|
+
@hash = T.let(T.unsafe(nil), T::Hash[Symbol, T.untyped])
|
1472
|
+
@data = T.let(T.unsafe(nil), String)
|
1473
|
+
@udata = T.let(T.unsafe(nil), T.nilable(String))
|
1474
|
+
end
|
1475
|
+
|
1476
|
+
sig { returns(String) }
|
1477
|
+
def unfiltered_data; end
|
1478
|
+
end
|
1479
|
+
|
1480
|
+
class SynchronizedCache
|
1481
|
+
sig { void }
|
1482
|
+
def initialize; end
|
1483
|
+
|
1484
|
+
sig { params(key: T.untyped).returns(T.untyped) }
|
1485
|
+
def [](key); end
|
1486
|
+
|
1487
|
+
sig { params(key: T.untyped, value: T.untyped).returns(T.untyped) }
|
1488
|
+
def []=(key, value); end
|
1489
|
+
end
|
1490
|
+
|
1491
|
+
class TextRun
|
1492
|
+
include Comparable
|
1493
|
+
|
1494
|
+
sig { returns(T.untyped) }
|
1495
|
+
attr_reader :x
|
1496
|
+
|
1497
|
+
sig { returns(T.untyped) }
|
1498
|
+
attr_reader :y
|
1499
|
+
|
1500
|
+
sig { returns(T.untyped) }
|
1501
|
+
attr_reader :width
|
1502
|
+
|
1503
|
+
sig { returns(T.untyped) }
|
1504
|
+
attr_reader :font_size
|
1505
|
+
|
1506
|
+
sig { returns(T.untyped) }
|
1507
|
+
attr_reader :text
|
1508
|
+
|
1509
|
+
sig do
|
1510
|
+
params(
|
1511
|
+
x: T.untyped,
|
1512
|
+
y: T.untyped,
|
1513
|
+
width: T.untyped,
|
1514
|
+
font_size: T.untyped,
|
1515
|
+
text: T.untyped
|
1516
|
+
).void
|
1517
|
+
end
|
1518
|
+
def initialize(x, y, width, font_size, text); end
|
1519
|
+
|
1520
|
+
sig { params(other: T.untyped).returns(T.untyped) }
|
1521
|
+
def <=>(other); end
|
1522
|
+
|
1523
|
+
sig { returns(T.untyped) }
|
1524
|
+
def endx; end
|
1525
|
+
|
1526
|
+
sig { returns(T.untyped) }
|
1527
|
+
def endy; end
|
1528
|
+
|
1529
|
+
sig { returns(T.untyped) }
|
1530
|
+
def mean_character_width; end
|
1531
|
+
|
1532
|
+
sig { params(other: PDF::Reader::TextRun).returns(T::Boolean) }
|
1533
|
+
def mergable?(other); end
|
1534
|
+
|
1535
|
+
sig { params(other: PDF::Reader::TextRun).returns(PDF::Reader::TextRun) }
|
1536
|
+
def +(other); end
|
1537
|
+
|
1538
|
+
sig { returns(T.untyped) }
|
1539
|
+
def inspect; end
|
1540
|
+
|
1541
|
+
sig { params(other_run: T.untyped).returns(T.untyped) }
|
1542
|
+
def intersect?(other_run); end
|
1543
|
+
|
1544
|
+
sig { params(other_run: T.untyped).returns(T.untyped) }
|
1545
|
+
def intersection_area_percent(other_run); end
|
1546
|
+
|
1547
|
+
sig { returns(T.untyped) }
|
1548
|
+
def area; end
|
1549
|
+
|
1550
|
+
sig { returns(T.untyped) }
|
1551
|
+
def mergable_range; end
|
1552
|
+
|
1553
|
+
sig { returns(T.untyped) }
|
1554
|
+
def character_count; end
|
1555
|
+
end
|
1556
|
+
|
1557
|
+
class Token < String
|
1558
|
+
sig { params(val: T.untyped).void }
|
1559
|
+
def initialize(val); end
|
1560
|
+
end
|
1561
|
+
|
1562
|
+
class TransformationMatrix
|
1563
|
+
sig { returns(T.untyped) }
|
1564
|
+
attr_reader :a
|
1565
|
+
|
1566
|
+
sig { returns(T.untyped) }
|
1567
|
+
attr_reader :b
|
1568
|
+
|
1569
|
+
sig { returns(T.untyped) }
|
1570
|
+
attr_reader :c
|
1571
|
+
|
1572
|
+
sig { returns(T.untyped) }
|
1573
|
+
attr_reader :d
|
1574
|
+
|
1575
|
+
sig { returns(T.untyped) }
|
1576
|
+
attr_reader :e
|
1577
|
+
|
1578
|
+
sig { returns(T.untyped) }
|
1579
|
+
attr_reader :f
|
1580
|
+
|
1581
|
+
sig do
|
1582
|
+
params(
|
1583
|
+
a: T.untyped,
|
1584
|
+
b: T.untyped,
|
1585
|
+
c: T.untyped,
|
1586
|
+
d: T.untyped,
|
1587
|
+
e: T.untyped,
|
1588
|
+
f: T.untyped
|
1589
|
+
).void
|
1590
|
+
end
|
1591
|
+
def initialize(a, b, c, d, e, f); end
|
1592
|
+
|
1593
|
+
sig { returns(T.untyped) }
|
1594
|
+
def inspect; end
|
1595
|
+
|
1596
|
+
sig { returns(T.untyped) }
|
1597
|
+
def to_a; end
|
1598
|
+
|
1599
|
+
sig do
|
1600
|
+
params(
|
1601
|
+
a: T.untyped,
|
1602
|
+
b: T.untyped,
|
1603
|
+
c: T.untyped,
|
1604
|
+
d: T.untyped,
|
1605
|
+
e: T.untyped,
|
1606
|
+
f: T.untyped
|
1607
|
+
).returns(T.untyped)
|
1608
|
+
end
|
1609
|
+
def multiply!(a, b = nil, c = nil, d = nil, e = nil, f = nil); end
|
1610
|
+
|
1611
|
+
sig { params(e2: T.untyped).returns(T.untyped) }
|
1612
|
+
def horizontal_displacement_multiply!(e2); end
|
1613
|
+
|
1614
|
+
sig do
|
1615
|
+
params(
|
1616
|
+
a2: T.untyped,
|
1617
|
+
b2: T.untyped,
|
1618
|
+
c2: T.untyped,
|
1619
|
+
d2: T.untyped,
|
1620
|
+
e2: T.untyped,
|
1621
|
+
f2: T.untyped
|
1622
|
+
).returns(T.untyped)
|
1623
|
+
end
|
1624
|
+
def horizontal_displacement_multiply_reversed!(a2, b2, c2, d2, e2, f2); end
|
1625
|
+
|
1626
|
+
sig do
|
1627
|
+
params(
|
1628
|
+
a2: T.untyped,
|
1629
|
+
b2: T.untyped,
|
1630
|
+
c2: T.untyped,
|
1631
|
+
d2: T.untyped,
|
1632
|
+
e2: T.untyped,
|
1633
|
+
f2: T.untyped
|
1634
|
+
).returns(T.untyped)
|
1635
|
+
end
|
1636
|
+
def xy_scaling_multiply!(a2, b2, c2, d2, e2, f2); end
|
1637
|
+
|
1638
|
+
sig do
|
1639
|
+
params(
|
1640
|
+
a2: T.untyped,
|
1641
|
+
b2: T.untyped,
|
1642
|
+
c2: T.untyped,
|
1643
|
+
d2: T.untyped,
|
1644
|
+
e2: T.untyped,
|
1645
|
+
f2: T.untyped
|
1646
|
+
).returns(T.untyped)
|
1647
|
+
end
|
1648
|
+
def xy_scaling_multiply_reversed!(a2, b2, c2, d2, e2, f2); end
|
1649
|
+
|
1650
|
+
sig do
|
1651
|
+
params(
|
1652
|
+
a2: T.untyped,
|
1653
|
+
b2: T.untyped,
|
1654
|
+
c2: T.untyped,
|
1655
|
+
d2: T.untyped,
|
1656
|
+
e2: T.untyped,
|
1657
|
+
f2: T.untyped
|
1658
|
+
).returns(T.untyped)
|
1659
|
+
end
|
1660
|
+
def regular_multiply!(a2, b2, c2, d2, e2, f2); end
|
1661
|
+
|
1662
|
+
sig do
|
1663
|
+
params(
|
1664
|
+
a2: T.untyped,
|
1665
|
+
b2: T.untyped,
|
1666
|
+
c2: T.untyped,
|
1667
|
+
d2: T.untyped,
|
1668
|
+
e2: T.untyped,
|
1669
|
+
f2: T.untyped
|
1670
|
+
).returns(T.untyped)
|
1671
|
+
end
|
1672
|
+
def faster_multiply!(a2, b2, c2, d2, e2, f2); end
|
1673
|
+
end
|
1674
|
+
|
1675
|
+
class TypeCheck
|
1676
|
+
|
1677
|
+
sig { params(obj: T.untyped).returns(Numeric) }
|
1678
|
+
def self.cast_to_numeric!(obj); end
|
1679
|
+
|
1680
|
+
sig { params(string: T.untyped).returns(String) }
|
1681
|
+
def self.cast_to_string!(string); end
|
1682
|
+
|
1683
|
+
sig { params(obj: T.untyped).returns(T.nilable(Symbol)) }
|
1684
|
+
def self.cast_to_symbol(obj); end
|
1685
|
+
end
|
1686
|
+
|
1687
|
+
class ValidatingReceiver
|
1688
|
+
sig { params(wrapped: T.untyped).void }
|
1689
|
+
def initialize(wrapped)
|
1690
|
+
@wrapped = T.let(T.unsafe(nil), T.untyped)
|
1691
|
+
end
|
1692
|
+
|
1693
|
+
sig { params(page: PDF::Reader::Page).void }
|
1694
|
+
def page=(page); end
|
1695
|
+
|
1696
|
+
sig { params(args: T.untyped).void }
|
1697
|
+
def save_graphics_state(*args); end
|
1698
|
+
|
1699
|
+
sig { params(args: T.untyped).void }
|
1700
|
+
def restore_graphics_state(*args); end
|
1701
|
+
|
1702
|
+
sig { params(args: T.untyped).void }
|
1703
|
+
def concatenate_matrix(*args); end
|
1704
|
+
|
1705
|
+
sig { params(args: T.untyped).void }
|
1706
|
+
def begin_text_object(*args); end
|
1707
|
+
|
1708
|
+
sig { params(args: T.untyped).void }
|
1709
|
+
def end_text_object(*args); end
|
1710
|
+
|
1711
|
+
sig { params(args: T.untyped).void }
|
1712
|
+
def set_character_spacing(*args); end
|
1713
|
+
|
1714
|
+
sig { params(args: T.untyped).void }
|
1715
|
+
def set_horizontal_text_scaling(*args); end
|
1716
|
+
|
1717
|
+
sig { params(args: T.untyped).void }
|
1718
|
+
def set_text_font_and_size(*args); end
|
1719
|
+
|
1720
|
+
sig { params(args: T.untyped).void }
|
1721
|
+
def set_text_leading(*args); end
|
1722
|
+
|
1723
|
+
sig { params(args: T.untyped).void }
|
1724
|
+
def set_text_rendering_mode(*args); end
|
1725
|
+
|
1726
|
+
sig { params(args: T.untyped).void }
|
1727
|
+
def set_text_rise(*args); end
|
1728
|
+
|
1729
|
+
sig { params(args: T.untyped).void }
|
1730
|
+
def set_word_spacing(*args); end
|
1731
|
+
|
1732
|
+
sig { params(args: T.untyped).void }
|
1733
|
+
def move_text_position(*args); end
|
1734
|
+
|
1735
|
+
sig { params(args: T.untyped).void }
|
1736
|
+
def move_text_position_and_set_leading(*args); end
|
1737
|
+
|
1738
|
+
sig { params(args: T.untyped).void }
|
1739
|
+
def set_text_matrix_and_text_line_matrix(*args); end
|
1740
|
+
|
1741
|
+
sig { params(args: T.untyped).void }
|
1742
|
+
def move_to_start_of_next_line(*args); end
|
1743
|
+
|
1744
|
+
sig { params(args: T.untyped).void }
|
1745
|
+
def show_text(*args); end
|
1746
|
+
|
1747
|
+
sig { params(args: T.untyped).void }
|
1748
|
+
def show_text_with_positioning(*args); end
|
1749
|
+
|
1750
|
+
sig { params(args: T.untyped).void }
|
1751
|
+
def move_to_next_line_and_show_text(*args); end
|
1752
|
+
|
1753
|
+
sig { params(args: T.untyped).void }
|
1754
|
+
def set_spacing_next_line_show_text(*args); end
|
1755
|
+
|
1756
|
+
sig { params(args: T.untyped).void }
|
1757
|
+
def invoke_xobject(*args); end
|
1758
|
+
|
1759
|
+
sig { params(args: T.untyped).void }
|
1760
|
+
def begin_inline_image(*args); end
|
1761
|
+
|
1762
|
+
sig { params(args: T.untyped).void }
|
1763
|
+
def begin_inline_image_data(*args); end
|
1764
|
+
|
1765
|
+
sig { params(args: T.untyped).void }
|
1766
|
+
def end_inline_image(*args); end
|
1767
|
+
|
1768
|
+
sig { params(meth: T.untyped).returns(T::Boolean) }
|
1769
|
+
def respond_to?(meth); end
|
1770
|
+
|
1771
|
+
sig { params(methodname: Symbol, args: T.untyped).void }
|
1772
|
+
def method_missing(methodname, *args); end
|
1773
|
+
|
1774
|
+
sig { params(methodname: T.untyped, args: T.untyped).void }
|
1775
|
+
def call_wrapped(methodname, *args); end
|
1776
|
+
end
|
1777
|
+
|
1778
|
+
class UnimplementedSecurityHandler
|
1779
|
+
sig { params(encrypt: T.untyped).returns(T.untyped) }
|
1780
|
+
def self.supports?(encrypt); end
|
1781
|
+
|
1782
|
+
sig { params(buf: T.untyped, ref: T.untyped).returns(T.untyped) }
|
1783
|
+
def decrypt(buf, ref); end
|
1784
|
+
end
|
1785
|
+
|
1786
|
+
class XRef
|
1787
|
+
include Enumerable
|
1788
|
+
|
1789
|
+
sig { returns(T.untyped) }
|
1790
|
+
attr_reader :trailer
|
1791
|
+
|
1792
|
+
sig { params(io: T.untyped).void }
|
1793
|
+
def initialize(io); end
|
1794
|
+
|
1795
|
+
sig { returns(T.untyped) }
|
1796
|
+
def size; end
|
1797
|
+
|
1798
|
+
sig { params(ref: T.untyped).returns(T.untyped) }
|
1799
|
+
def [](ref); end
|
1800
|
+
|
1801
|
+
sig { params(block: T.untyped).returns(T.untyped) }
|
1802
|
+
def each(&block); end
|
1803
|
+
|
1804
|
+
sig { params(offset: T.untyped).returns(T.untyped) }
|
1805
|
+
def load_offsets(offset = nil); end
|
1806
|
+
|
1807
|
+
sig { params(buf: T.untyped).returns(T.untyped) }
|
1808
|
+
def load_xref_table(buf); end
|
1809
|
+
|
1810
|
+
sig { params(stream: T.untyped).returns(T.untyped) }
|
1811
|
+
def load_xref_stream(stream); end
|
1812
|
+
|
1813
|
+
sig { params(bytes: T.untyped).returns(T.untyped) }
|
1814
|
+
def unpack_bytes(bytes); end
|
1815
|
+
|
1816
|
+
sig { params(offset: T.untyped).returns(T.untyped) }
|
1817
|
+
def new_buffer(offset = 0); end
|
1818
|
+
|
1819
|
+
sig { params(id: T.untyped, gen: T.untyped, offset: T.untyped).returns(T.untyped) }
|
1820
|
+
def store(id, gen, offset); end
|
1821
|
+
|
1822
|
+
sig { params(io: T.untyped).returns(T.untyped) }
|
1823
|
+
def calc_junk_offset(io); end
|
1824
|
+
end
|
1825
|
+
|
1826
|
+
class ZeroWidthRunsFilter
|
1827
|
+
sig { params(runs: T::Array[PDF::Reader::TextRun]).returns(T::Array[PDF::Reader::TextRun]) }
|
1828
|
+
def self.exclude_zero_width_runs(runs); end
|
1829
|
+
end
|
1830
|
+
|
1831
|
+
module Filter
|
1832
|
+
sig { params(name: Symbol, options: T::Hash[T.untyped, T.untyped]).returns(T.untyped) }
|
1833
|
+
def self.with(name, options = {}); end
|
1834
|
+
|
1835
|
+
class Ascii85
|
1836
|
+
sig { params(options: T::Hash[T.untyped, T.untyped]).void }
|
1837
|
+
def initialize(options = {})
|
1838
|
+
@options = T.let(T.unsafe(nil), T::Hash[T.untyped, T.untyped])
|
1839
|
+
end
|
1840
|
+
|
1841
|
+
sig { params(data: String).returns(String) }
|
1842
|
+
def filter(data); end
|
1843
|
+
end
|
1844
|
+
|
1845
|
+
class AsciiHex
|
1846
|
+
sig { params(options: T::Hash[T.untyped, T.untyped]).void }
|
1847
|
+
def initialize(options = {})
|
1848
|
+
@options = T.let(T.unsafe(nil), T::Hash[T.untyped, T.untyped])
|
1849
|
+
end
|
1850
|
+
|
1851
|
+
sig { params(data: String).returns(String) }
|
1852
|
+
def filter(data); end
|
1853
|
+
end
|
1854
|
+
|
1855
|
+
class Depredict
|
1856
|
+
sig { params(options: T::Hash[T.untyped, T.untyped]).void }
|
1857
|
+
def initialize(options = {}); end
|
1858
|
+
|
1859
|
+
sig { params(data: String).returns(String) }
|
1860
|
+
def filter(data); end
|
1861
|
+
|
1862
|
+
sig { params(data: T.untyped).returns(T.untyped) }
|
1863
|
+
def tiff_depredict(data); end
|
1864
|
+
|
1865
|
+
sig { params(data: T.untyped).returns(T.untyped) }
|
1866
|
+
def png_depredict(data); end
|
1867
|
+
end
|
1868
|
+
|
1869
|
+
class Flate
|
1870
|
+
ZLIB_AUTO_DETECT_ZLIB_OR_GZIP = 47
|
1871
|
+
ZLIB_RAW_DEFLATE = -15
|
1872
|
+
|
1873
|
+
sig { params(options: T::Hash[T.untyped, T.untyped]).void }
|
1874
|
+
def initialize(options = {})
|
1875
|
+
@options = T.let(T.unsafe(nil), T::Hash[T.untyped, T.untyped])
|
1876
|
+
end
|
1877
|
+
|
1878
|
+
sig { params(data: String).returns(String) }
|
1879
|
+
def filter(data); end
|
1880
|
+
|
1881
|
+
sig { params(data: T.untyped).returns(T.untyped) }
|
1882
|
+
def zlib_inflate(data); end
|
1883
|
+
end
|
1884
|
+
|
1885
|
+
class Lzw
|
1886
|
+
sig { params(options: T::Hash[T.untyped, T.untyped]).void }
|
1887
|
+
def initialize(options = {})
|
1888
|
+
@options = T.let(T.unsafe(nil), T::Hash[T.untyped, T.untyped])
|
1889
|
+
end
|
1890
|
+
|
1891
|
+
sig { params(data: String).returns(String) }
|
1892
|
+
def filter(data); end
|
1893
|
+
end
|
1894
|
+
|
1895
|
+
class Null
|
1896
|
+
sig { params(options: T::Hash[T.untyped, T.untyped]).void }
|
1897
|
+
def initialize(options = {})
|
1898
|
+
@options = T.let(T.unsafe(nil), T::Hash[T.untyped, T.untyped])
|
1899
|
+
end
|
1900
|
+
|
1901
|
+
sig { params(data: T.untyped).returns(T.untyped) }
|
1902
|
+
def filter(data); end
|
1903
|
+
end
|
1904
|
+
|
1905
|
+
class RunLength
|
1906
|
+
sig { params(options: T::Hash[T.untyped, T.untyped]).void }
|
1907
|
+
def initialize(options = {})
|
1908
|
+
@options = T.let(T.unsafe(nil), T::Hash[T.untyped, T.untyped])
|
1909
|
+
end
|
1910
|
+
|
1911
|
+
sig { params(data: String).returns(String) }
|
1912
|
+
def filter(data); end
|
1913
|
+
end
|
1914
|
+
end
|
1915
|
+
|
1916
|
+
module WidthCalculator
|
1917
|
+
class BuiltIn
|
1918
|
+
BUILTINS = [
|
1919
|
+
:Courier, :"Courier-Bold", :"Courier-BoldOblique", :"Courier-Oblique",
|
1920
|
+
:Helvetica, :"Helvetica-Bold", :"Helvetica-BoldOblique", :"Helvetica-Oblique",
|
1921
|
+
:Symbol,
|
1922
|
+
:"Times-Roman", :"Times-Bold", :"Times-BoldItalic", :"Times-Italic",
|
1923
|
+
:ZapfDingbats
|
1924
|
+
]
|
1925
|
+
|
1926
|
+
sig { params(font: T.untyped).void }
|
1927
|
+
def initialize(font); end
|
1928
|
+
|
1929
|
+
sig { params(code_point: T.untyped).returns(T.untyped) }
|
1930
|
+
def glyph_width(code_point); end
|
1931
|
+
|
1932
|
+
sig { params(code_point: T.untyped).returns(T.untyped) }
|
1933
|
+
def control_character?(code_point); end
|
1934
|
+
|
1935
|
+
sig { params(font_name: T.untyped).returns(T.untyped) }
|
1936
|
+
def extract_basefont(font_name); end
|
1937
|
+
end
|
1938
|
+
|
1939
|
+
class Composite
|
1940
|
+
sig { params(font: T.untyped).void }
|
1941
|
+
def initialize(font); end
|
1942
|
+
|
1943
|
+
sig { params(code_point: T.untyped).returns(T.untyped) }
|
1944
|
+
def glyph_width(code_point); end
|
1945
|
+
end
|
1946
|
+
|
1947
|
+
class TrueType
|
1948
|
+
sig { params(font: T.untyped).void }
|
1949
|
+
def initialize(font); end
|
1950
|
+
|
1951
|
+
sig { params(code_point: T.untyped).returns(T.untyped) }
|
1952
|
+
def glyph_width(code_point); end
|
1953
|
+
|
1954
|
+
sig { params(code_point: T.untyped).returns(T.untyped) }
|
1955
|
+
def glyph_width_from_font(code_point); end
|
1956
|
+
|
1957
|
+
sig { params(code_point: T.untyped).returns(T.untyped) }
|
1958
|
+
def glyph_width_from_descriptor(code_point); end
|
1959
|
+
end
|
1960
|
+
|
1961
|
+
class TypeOneOrThree
|
1962
|
+
sig { params(font: T.untyped).void }
|
1963
|
+
def initialize(font); end
|
1964
|
+
|
1965
|
+
sig { params(code_point: T.untyped).returns(T.untyped) }
|
1966
|
+
def glyph_width(code_point); end
|
1967
|
+
end
|
1968
|
+
|
1969
|
+
class TypeZero
|
1970
|
+
sig { params(font: T.untyped).void }
|
1971
|
+
def initialize(font); end
|
1972
|
+
|
1973
|
+
sig { params(code_point: T.untyped).returns(T.untyped) }
|
1974
|
+
def glyph_width(code_point); end
|
1975
|
+
end
|
1976
|
+
end
|
1977
|
+
end
|
1978
|
+
end
|