pdf-reader 2.9.0 → 2.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b4616131d0ad73c4ef2c4992ae79d4fde420d6857aba60e8dfac9b088a0b915
4
- data.tar.gz: f93f481d7f76af426420dbf507a88e8ecead8ec84690781f42de3b7b5ffbd1bd
3
+ metadata.gz: 07c734cf3cfc0abf1102f813976d4936d33b57815f114ce92224bbd605fe16a2
4
+ data.tar.gz: f52b1751f83717a7bc96c56e8d830559d387fb430cfa6fa2a78604d98c7476f4
5
5
  SHA512:
6
- metadata.gz: 86dbe3450a11e0deb3f5db98625375b252cc25f289d76c98b5de48342d1b4957de81c1c2b6cce53d7d09738e9576bd48213c92166d48911c1f45ad6a77f195a5
7
- data.tar.gz: ee852ff644a095bae93eb7cc30c6d070c8c6adda4f9bfadecf938bf3ba2723fed08c75a3bf15ba30fcf8fded7ad6a5b74dad8a3f512823798686350f24b912eb
6
+ metadata.gz: 72fda8f6b32c20782adca6cca44d291c7cbe4ac9d858da5ed1c815af2a7d6680e3906cac47a8414923c8db639fd51365d9da8612c1c7f79a674b22448bb35cae
7
+ data.tar.gz: fa79a29d80a36d37e1188769bf7991d5108bbe08b11711a7c9bb1741cedd3682b77afe219a24ae7844fdbf10b23ca3eb5434f4b9418d7002f07fb8edf9dd6e26
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ v2.9.1 (4th February 2022)
2
+ - Fix exception in Page#walk introduced in 2.9.0 (http://github.com/yob/pdf-reader/pull/442)
3
+ - Other small bug fixes
4
+
1
5
  v2.9.0 (24th January 2022)
2
6
  - Support additional encryption standards (http://github.com/yob/pdf-reader/pull/419)
3
7
  - Return CropBox correctly from Page#rectangles (https://github.com/yob/pdf-reader/pull/420)
@@ -43,16 +43,15 @@ class PDF::Reader
43
43
  #
44
44
  def self.with(name, options = {})
45
45
  case name
46
- when :ASCII85Decode then PDF::Reader::Filter::Ascii85.new(options)
47
- when :ASCIIHexDecode then PDF::Reader::Filter::AsciiHex.new(options)
48
- when :CCITTFaxDecode then PDF::Reader::Filter::Null.new(options)
49
- when :DCTDecode then PDF::Reader::Filter::Null.new(options)
50
- when :FlateDecode then PDF::Reader::Filter::Flate.new(options)
51
- when :Fl then PDF::Reader::Filter::Flate.new(options)
52
- when :JBIG2Decode then PDF::Reader::Filter::Null.new(options)
53
- when :JPXDecode then PDF::Reader::Filter::Null.new(options)
54
- when :LZWDecode then PDF::Reader::Filter::Lzw.new(options)
55
- when :RunLengthDecode then PDF::Reader::Filter::RunLength.new(options)
46
+ when :ASCII85Decode, :A85 then PDF::Reader::Filter::Ascii85.new(options)
47
+ when :ASCIIHexDecode, :AHx then PDF::Reader::Filter::AsciiHex.new(options)
48
+ when :CCITTFaxDecode, :CCF then PDF::Reader::Filter::Null.new(options)
49
+ when :DCTDecode, :DCT then PDF::Reader::Filter::Null.new(options)
50
+ when :FlateDecode, :Fl then PDF::Reader::Filter::Flate.new(options)
51
+ when :JBIG2Decode then PDF::Reader::Filter::Null.new(options)
52
+ when :JPXDecode then PDF::Reader::Filter::Null.new(options)
53
+ when :LZWDecode, :LZW then PDF::Reader::Filter::Lzw.new(options)
54
+ when :RunLengthDecode, :RL then PDF::Reader::Filter::RunLength.new(options)
56
55
  else
57
56
  raise UnsupportedFeatureError, "Unknown filter: #{name}"
58
57
  end
@@ -96,7 +96,13 @@ class PDF::Reader
96
96
  # id - the object ID to return
97
97
  # gen - the object revision number to return
98
98
  def object(id, gen)
99
- Error.assert_equal(parse_token, id)
99
+ idCheck = parse_token
100
+
101
+ # Sometimes the xref table is corrupt and points to an offset slightly too early in the file.
102
+ # check the next token, maybe we can find the start of the object we're looking for
103
+ if idCheck != id
104
+ Error.assert_equal(parse_token, id)
105
+ end
100
106
  Error.assert_equal(parse_token, gen)
101
107
  Error.str_assert(parse_token, "obj")
102
108
 
@@ -222,7 +228,10 @@ class PDF::Reader
222
228
  data = @buffer.read(length, :skip_eol => true)
223
229
 
224
230
  Error.str_assert(parse_token, "endstream")
225
- Error.str_assert(parse_token, "endobj")
231
+
232
+ # We used to assert that the stream had the correct closing token, but it doesn't *really*
233
+ # matter if it's missing, and other readers seems to handle its absence just fine
234
+ # Error.str_assert(parse_token, "endobj")
226
235
 
227
236
  PDF::Reader::Stream.new(dict, data)
228
237
  end
@@ -249,7 +249,7 @@ module PDF
249
249
  end
250
250
 
251
251
  def method_missing(methodname, *args)
252
- @wrapped.call(methodname, *args)
252
+ @wrapped.send(methodname, *args)
253
253
  end
254
254
 
255
255
  private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdf-reader
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.0
4
+ version: 2.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Healy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-24 00:00:00.000000000 Z
11
+ date: 2022-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -288,9 +288,9 @@ licenses:
288
288
  - MIT
289
289
  metadata:
290
290
  bug_tracker_uri: https://github.com/yob/pdf-reader/issues
291
- changelog_uri: https://github.com/yob/pdf-reader/blob/v2.9.0/CHANGELOG
292
- documentation_uri: https://www.rubydoc.info/gems/pdf-reader/2.9.0
293
- source_code_uri: https://github.com/yob/pdf-reader/tree/v2.9.0
291
+ changelog_uri: https://github.com/yob/pdf-reader/blob/v2.9.1/CHANGELOG
292
+ documentation_uri: https://www.rubydoc.info/gems/pdf-reader/2.9.1
293
+ source_code_uri: https://github.com/yob/pdf-reader/tree/v2.9.1
294
294
  post_install_message:
295
295
  rdoc_options:
296
296
  - "--title"
@@ -311,7 +311,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
311
311
  - !ruby/object:Gem::Version
312
312
  version: '0'
313
313
  requirements: []
314
- rubygems_version: 3.1.6
314
+ rubygems_version: 3.2.32
315
315
  signing_key:
316
316
  specification_version: 4
317
317
  summary: A library for accessing the content of PDF files