pdf-reader 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/Rakefile +1 -1
- data/lib/pdf/hash.rb +11 -1
- metadata +2 -2
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
data/lib/pdf/hash.rb
CHANGED
@@ -27,7 +27,7 @@ module PDF
|
|
27
27
|
include Enumerable
|
28
28
|
|
29
29
|
attr_accessor :default
|
30
|
-
attr_reader :trailer
|
30
|
+
attr_reader :trailer, :version
|
31
31
|
|
32
32
|
# Creates a new PDF:Hash object. input can be a string with a valid filename,
|
33
33
|
# a string containing a PDF file, or an IO object.
|
@@ -45,6 +45,7 @@ module PDF
|
|
45
45
|
else
|
46
46
|
raise ArgumentError, "input must be an IO-like object or a filename"
|
47
47
|
end
|
48
|
+
@version = read_version(io)
|
48
49
|
buffer = PDF::Reader::Buffer.new(io)
|
49
50
|
@xref = PDF::Reader::XRef.new(buffer)
|
50
51
|
@trailer = @xref.load
|
@@ -198,5 +199,14 @@ module PDF
|
|
198
199
|
ret
|
199
200
|
end
|
200
201
|
|
202
|
+
private
|
203
|
+
|
204
|
+
def read_version(io)
|
205
|
+
io.seek(0)
|
206
|
+
m, version = *io.read(10).match(/PDF-(\d.\d)/)
|
207
|
+
io.seek(0)
|
208
|
+
version
|
209
|
+
end
|
210
|
+
|
201
211
|
end
|
202
212
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdf-reader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Jones
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-27 00:00:00 +11:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|