pdf-reader 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,10 @@
1
+ v0.9.1 (21st December 2010)
2
+ - force gem to only install on ruby 1.8.7 or higher
3
+ - maintaining supprot for earlier versions takes more time than I have
4
+ available at the moment
5
+ - bug: fix parsing of obscure pdf name format
6
+ - bug: fix behaviour when loaded in confunction with htmldoc gem
7
+
1
8
  v0.9.0 (19th November 2010)
2
9
  - support for pdf 1.5+ files that use object and xref streams
3
10
  - support streams that use a flate filter with the predictor option
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
3
  module PDF
4
- class Hash < PDF::Reader::ObjectHash # :nodoc:
4
+ class Hash < ::PDF::Reader::ObjectHash # :nodoc:
5
5
  def initialize(input)
6
6
  warn "DEPRECATION NOTICE: PDF::Hash has been deprecated, use PDF::Reader::ObjectHash instead"
7
7
  super
@@ -115,7 +115,7 @@ module PDF
115
115
  ohash = ObjectHash.new(io)
116
116
 
117
117
  if ohash.trailer[:Encrypt]
118
- raise PDF::Reader::UnsupportedFeatureError, 'PDF::Reader cannot read encrypted PDF files'
118
+ raise ::PDF::Reader::UnsupportedFeatureError, 'PDF::Reader cannot read encrypted PDF files'
119
119
  end
120
120
 
121
121
  options = {:pages => true, :raw_text => false, :metadata => true}
@@ -140,8 +140,8 @@ module PDF
140
140
 
141
141
  def strategies
142
142
  @strategies ||= [
143
- PDF::Reader::MetadataStrategy,
144
- PDF::Reader::PagesStrategy
143
+ ::PDF::Reader::MetadataStrategy,
144
+ ::PDF::Reader::PagesStrategy
145
145
  ]
146
146
  end
147
147
  end
@@ -79,10 +79,10 @@ class PDF::Reader
79
79
 
80
80
  obj = parse_token
81
81
  post_obj = parse_token
82
- case post_obj
83
- when "endobj" then return obj
84
- when "stream" then return stream(obj)
85
- else raise MalformedPDFError, "PDF malformed, unexpected token #{post_obj}"
82
+ if post_obj == "stream"
83
+ stream(obj)
84
+ else
85
+ obj
86
86
  end
87
87
  end
88
88
 
@@ -109,7 +109,7 @@ class PDF::Reader
109
109
  # reads a PDF name from the buffer and converts it to a Ruby Symbol
110
110
  def pdf_name
111
111
  tok = @buffer.token
112
- tok.scan(/#(\d\d)/).each do |find|
112
+ tok.scan(/#([A-Fa-f0-9]{2})/).each do |find|
113
113
  replace = find[0].hex.chr
114
114
  tok.gsub!("#"+find[0], replace)
115
115
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdf-reader
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 0
10
- version: 0.9.0
9
+ - 1
10
+ version: 0.9.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Healy
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-19 00:00:00 -05:00
18
+ date: 2010-12-21 00:00:00 +11:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -77,7 +77,8 @@ dependencies:
77
77
  type: :runtime
78
78
  version_requirements: *id004
79
79
  description: The PDF::Reader library implements a PDF parser conforming as much as possible to the PDF specification from Adobe
80
- email: jimmy@deefa.com
80
+ email:
81
+ - jimmy@deefa.com
81
82
  executables:
82
83
  - pdf_object
83
84
  - pdf_text
@@ -157,10 +158,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
157
158
  requirements:
158
159
  - - ">="
159
160
  - !ruby/object:Gem::Version
160
- hash: 3
161
+ hash: 57
161
162
  segments:
162
- - 0
163
- version: "0"
163
+ - 1
164
+ - 8
165
+ - 7
166
+ version: 1.8.7
164
167
  required_rubygems_version: !ruby/object:Gem::Requirement
165
168
  none: false
166
169
  requirements: