combine_pdf 1.0.12 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 065b22eadabeec63902f6ba3bd0fb551ef6cdb37f62e10856f203110a70a23cc
4
- data.tar.gz: 30a9b38087298a1de88ad1c76fbfd16133e40b152109bef3d55e372ee993fa80
3
+ metadata.gz: 3ca8e3d75a2b167718e3f749076bd5bbbd1701b0218a811fd9fed4dda23c194a
4
+ data.tar.gz: 71bae00e5caeba7b1f70d2fc3492a669b5c05fcde8d56a9b58b7bbda2010cec9
5
5
  SHA512:
6
- metadata.gz: 9df5436a25b1c75819cffd89a35b915e4cd6bdc74703da71a62f7556299fc76297ac7e47dbad72585f158302f6554fb94910487ac2fd31e7f04f632ec9b08744
7
- data.tar.gz: 19d9ce8eca5de1ce62e33d5d122946219a74bb35ee86ac87d1db80c6ca9acc4ca3878c31b28cf6a8dc8447f4c30f6d9608b50f61dbcc4713e0e77a581a0dd09f
6
+ metadata.gz: 4c680801b7c0c925e1c6a66459b51de48ff3942c1cf24d5b31dbad55a2fb88f434ac4f67404c81ee422e672c92fc852ba4708835904c1d041cc5537abc13ba87
7
+ data.tar.gz: b2cb8a1eecf10d2503193f09802dc25655cd79b8bf41d422c1c45152fb0cf98e2092788bc19e77d139ec5918fa42782a5f97a2e1e9a7f9703de5be5b4479d2ca
@@ -2,6 +2,10 @@
2
2
 
3
3
  ***
4
4
 
5
+ #### Change log v.1.0.13
6
+
7
+ **Fix**: Fixed an issue related to PDF object streams (version 1.6) where a numerical object at the beginning of the stream might be mis-parsed as an object reference number rather than an object. Credit to @Defoncesko for reporting issue #141.
8
+
5
9
  #### Change log v.1.0.12
6
10
 
7
11
  **Fix**: Fixed an issue introduced in version 1.0.11, where a fragmented XREF table might cause the CombinePDF::Parser to fail. Credit to @solasdev for reporting issue #140.
@@ -112,12 +112,13 @@ module CombinePDF
112
112
  next unless o.is_a?(Hash) && o[:Type] == :ObjStm
113
113
  ## un-encode (using the correct filter) the object streams
114
114
  PDFFilter.inflate_object o
115
+ # puts "Object Stream Found:", o[:raw_stream_content]
115
116
  ## extract objects from stream
116
117
  @scanner = StringScanner.new o[:raw_stream_content]
117
118
  stream_data = _parse_
118
119
  id_array = []
119
120
  collection = [nil]
120
- while stream_data[0].is_a? (Numeric)
121
+ while (stream_data[0].is_a?(Numeric) && stream_data[1].is_a?(Numeric))
121
122
  id_array << stream_data.shift
122
123
  stream_data.shift
123
124
  end
@@ -478,7 +479,7 @@ module CombinePDF
478
479
  ##########################################
479
480
  else
480
481
  # always advance
481
- warn "Advancing for unknown reason... #{@scanner.string[@scanner.pos - 4, 8]} ... #{@scanner.peek(4)}" unless @scanner.peek(1) =~ /[\s\n]/
482
+ # warn "Advancing for unknown reason... #{@scanner.string[@scanner.pos - 4, 8]} ... #{@scanner.peek(4)}" unless @scanner.peek(1) =~ /[\s\n]/
482
483
  warn 'Warning: parser advancing for unknown reason. Potential data-loss.'
483
484
  @scanner.pos = @scanner.pos + 1
484
485
  end
@@ -1,3 +1,3 @@
1
1
  module CombinePDF
2
- VERSION = '1.0.12'.freeze
2
+ VERSION = '1.0.13'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: combine_pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.12
4
+ version: 1.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boaz Segev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-02 00:00:00.000000000 Z
11
+ date: 2018-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-rc4