Skip to content
This repository has been archived by the owner on Nov 29, 2019. It is now read-only.

Commit

Permalink
lib: Move everything into a PdfExtract module.
Browse files Browse the repository at this point in the history
  • Loading branch information
kjw committed Jun 7, 2011
1 parent add75c2 commit 6154fc7
Show file tree
Hide file tree
Showing 6 changed files with 349 additions and 286 deletions.
22 changes: 22 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require 'rubygems'

spec = Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.summary = 'PDF text, region, section and section header extraction tool and library.'
s.name = 'pdf-extract'
s.version = '0.0.1'
s.require_path = 'lib'
s.files = ['lib/**/*.rb', 'bin/*', '[A-Z]*', 'test/**/*'].to_a
s.author = 'Karl Jonathan Ward'
s.required_ruby_version = '>= 1.9.1'

s.add_dependency 'pdf-reader', '>= 0.9.2'
s.add_dependency 'nokogiri', '>= 1.4.4'

s.executables << 'pdf-extract'
end

Rake::GemPackageTask.new spec do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
4 changes: 2 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

## Small tasks, 10 minutes or so

* Improve inclusion of spatial object modules. Shouldn't need to call,
for example, include_text_runs.
* DONE Improve inclusion of spatial object modules. Shouldn't need to
call, for example, include_text_runs.
* Pass set of previously constructed spatial objects to sptials calls,
via a new method in parser - parser.previous :text_runs { ... }.
Spatial objects such as margins depend on the positions of text
Expand Down
6 changes: 3 additions & 3 deletions pdfextract → bindir/pdf-extract
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ command :text do |c|

c.action do |args, options|
args.each do |filename|
xml = convert filename, :to => :xml do |pdf| pdf.text_runs end
xml = PdfExtract::view filename, :as => :xml do |pdf| pdf.text_runs end
say xml
end
end
Expand All @@ -30,7 +30,7 @@ command :mask do |c|

c.action do |args, options|
args.each do |filename|
image = view filename do |pdf|
image = PdfExtract::view filename, :as => :png do |pdf|
pdf.text_runs
pdf.regions
pdf.sections
Expand All @@ -46,7 +46,7 @@ command :sections do |c|

c.action do |args, options|
args.each do |filename|
xml = convert filename, :to => :xml do |pdf| pdf.sections end
xml = PdfExtract::view filename, :as => :xml do |pdf| pdf.sections end
say xml
end
end
Expand Down
Loading

0 comments on commit 6154fc7

Please sign in to comment.