pdf-reader 0.5 → 0.5.1

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.
Files changed (6) hide show
  1. data/CHANGELOG +4 -0
  2. data/README +17 -2
  3. data/Rakefile +1 -1
  4. data/TODO +1 -0
  5. data/lib/pdf/reader.rb +1 -1
  6. metadata +42 -35
data/CHANGELOG CHANGED
@@ -1,2 +1,6 @@
1
+ v0.5.1 (1st January 2008)
2
+ - Several documentation tweaks
3
+ - Improve support for parsing PDFs under windows (thanks to Jari Williamsson)
4
+
1
5
  v0.5 (14th December 2007)
2
6
  - Initial Release
data/README CHANGED
@@ -26,7 +26,8 @@ methods do is entirely up to you - save the text, extract images, count pages,
26
26
  read metadata, whatever.
27
27
 
28
28
  For a full list of the supported callback methods and a description of when they
29
- will be called, refer to PDF::Reader::Content.
29
+ will be called, refer to PDF::Reader::Content. See the code examples below for a
30
+ way to print a list of all the callbacks generated by a file to STDOUT.
30
31
 
31
32
  = Exceptions
32
33
 
@@ -72,7 +73,21 @@ A simple app to count the number of pages in a PDF File.
72
73
 
73
74
  receiver = PageReceiver.new
74
75
  pdf = PDF::Reader.file("somefile.pdf", receiver)
75
- puts "#{pdf.page_count} pages"
76
+ puts "#{receiver.page_count} pages"
77
+
78
+ == List all callbacks generated by a single PDF
79
+
80
+ WARNING: this will generate a *lot* of output, so you probably want to pipe
81
+ it through less or to a text file.
82
+
83
+ require 'rubygems'
84
+ require 'pdf/reader'
85
+
86
+ receiver = PDF::Reader::RegisterReceiver.new
87
+ pdf = PDF::Reader.file("somefile.pdf", receiver)
88
+ receiver.callbacks.each do |cb|
89
+ puts cb
90
+ end
76
91
 
77
92
  == Basic RSpec of a generated PDF
78
93
 
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rake/testtask'
6
6
  require "rake/gempackagetask"
7
7
  require 'spec/rake/spectask'
8
8
 
9
- PKG_VERSION = "0.5"
9
+ PKG_VERSION = "0.5.1"
10
10
  PKG_NAME = "pdf-reader"
11
11
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
12
12
 
data/TODO CHANGED
@@ -7,3 +7,4 @@ Some ideas for future work
7
7
 
8
8
  - Improve metadata support
9
9
 
10
+ - Add support for additional filters: ASCIIHexDecode, ASCII85Decode, LZWDecode, RunLengthDecode, CCITTFaxDecode, JBIG2Decode, DCTDecode, JPXDecode, Crypt?
@@ -55,7 +55,7 @@ module PDF
55
55
  ################################################################################
56
56
  # Parse the file with the given name, sending events to the given receiver.
57
57
  def self.file (name, receiver)
58
- File.open(name) do |f|
58
+ File.open(name,"rb") do |f|
59
59
  new.parse(f, receiver)
60
60
  end
61
61
  end
metadata CHANGED
@@ -1,33 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: pdf-reader
5
3
  version: !ruby/object:Gem::Version
6
- version: "0.5"
7
- date: 2007-12-14 00:00:00 +11:00
8
- summary: A library for accessing the content of PDF files
9
- require_paths:
10
- - lib
11
- email: pjones@pmade.com
12
- homepage: http://software.pmade.com/pdfreader
13
- rubyforge_project: pdf-reader
14
- description: The PDF::Reader library implements a PDF parser conforming as much as possible to the PDF specification from Adobe
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 0.5.1
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Peter Jones
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-01-01 00:00:00 +11:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: The PDF::Reader library implements a PDF parser conforming as much as possible to the PDF specification from Adobe
17
+ email: pjones@pmade.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README
24
+ - TODO
25
+ - CHANGELOG
31
26
  files:
32
27
  - lib/pdf
33
28
  - lib/pdf/reader
@@ -48,23 +43,35 @@ files:
48
43
  - README
49
44
  - TODO
50
45
  - CHANGELOG
51
- test_files: []
52
-
46
+ has_rdoc: true
47
+ homepage: http://software.pmade.com/pdfreader
48
+ post_install_message:
53
49
  rdoc_options:
54
50
  - --title
55
51
  - PDF::Reader Documentation
56
52
  - --main
57
53
  - README
58
54
  - -q
59
- extra_rdoc_files:
60
- - README
61
- - TODO
62
- - CHANGELOG
63
- executables: []
64
-
65
- extensions: []
66
-
55
+ require_paths:
56
+ - lib
57
+ required_ruby_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: "0"
62
+ version:
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ version:
67
69
  requirements: []
68
70
 
69
- dependencies: []
71
+ rubyforge_project: pdf-reader
72
+ rubygems_version: 1.0.1
73
+ signing_key:
74
+ specification_version: 2
75
+ summary: A library for accessing the content of PDF files
76
+ test_files: []
70
77