combine_pdf 0.1.20 → 0.1.21

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
  SHA1:
3
- metadata.gz: f0a1ba8e7f8d04a0e479de6d9535a814c708fa08
4
- data.tar.gz: a97752cfb5af1b84d56d96919f850af59987ed89
3
+ metadata.gz: de5890a0bbc35644a9438b7b2c34aeb562edd59f
4
+ data.tar.gz: e7af63840188c28b12515c37c02ea87fc2a22d6b
5
5
  SHA512:
6
- metadata.gz: 2b9758ed89f19800a2f43ff272e0f5bc5e16d1dc2446540f567fc66a86845f178f42fc3dcee77f4ffbd516b81df6216cac25d4e4c13c595080ea6a40df558f22
7
- data.tar.gz: 05b7a3355d5441311d7cdd3ae5214c8a2b207a03bee37d363811c7f64471b9d7e0df1915c2d090fe198db2ba5766431ff5377eb17b2ce901a2613cde700399a4
6
+ metadata.gz: cee07e844a7890f815f6af4af80ba7cecc952df630f158d7265e0102c2f8719ac7a1b5ca05e3a9d5a0e53b1d247eebb49671bfc203f946d276b32beeb3223616
7
+ data.tar.gz: 3a19e222a63e1627f91fd9fe5058ca95370667ad24ae66db1312a268e781ccb067a7d422788e17000006bb3c1aad4b2bdf1fe1d1c4748a96f0ba5c8a7f687082
data/CHANGELOG.md CHANGED
@@ -3,9 +3,8 @@
3
3
  ***
4
4
 
5
5
  Change log v.0.1.21
6
- (pre-release)
7
6
 
8
- No changes yet.
7
+ **fix**: an attempted fix for issue #19, where the xref table wasn't read on Acrobat Reader, probably due to a double EOL marker at the end of each entry.
9
8
 
10
9
  ***
11
10
 
@@ -15,7 +15,7 @@ module CombinePDF
15
15
  PDF.new( PDFParser.new( IO.read(file_name, mode: 'rb').force_encoding(Encoding::ASCII_8BIT) ) )
16
16
  end
17
17
  def new(file_name = "")
18
- load(file_name)
18
+ load(file_name) rescue parse(file_name)
19
19
  end
20
20
 
21
21
  # Create a PDF object from a raw PDF data (parsing the data).
@@ -149,12 +149,13 @@ module CombinePDF
149
149
  indirect_object_count += 1
150
150
  xref << loc
151
151
  out << PDFOperations._object_to_pdf(o)
152
- loc += out.last.length + 1
152
+ loc += out.last.bytesize + 1
153
153
  end
154
- xref_location = 0
155
- out.each { |line| xref_location += line.bytesize + 1}
156
- out << "xref\n\r0 #{(indirect_object_count).to_s}\n\r0000000000 65535 f \n\r"
157
- xref.each {|offset| out << ( out.pop + ("%010d 00000 n \n\r" % offset) ) }
154
+ xref_location = loc
155
+ # xref_location = 0
156
+ # out.each { |line| xref_location += line.bytesize + 1}
157
+ out << "xref\n0 #{(indirect_object_count).to_s}\n0000000000 65535 f \n"
158
+ xref.each {|offset| out << ( out.pop + ("%010d 00000 n \n" % offset) ) }
158
159
  out << out.pop + "trailer"
159
160
  out << "<<\n/Root #{false || "#{catalog[:indirect_reference_id]} #{catalog[:indirect_generation_number]} R"}"
160
161
  out << "/Size #{indirect_object_count.to_s}"
@@ -1,3 +1,3 @@
1
1
  module CombinePDF
2
- VERSION = "0.1.20"
2
+ VERSION = "0.1.21"
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: 0.1.20
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boaz Segev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-04 00:00:00.000000000 Z
11
+ date: 2015-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-rc4