lib/grim/pdf.rb in grim-0.2.4 vs lib/grim/pdf.rb in grim-0.3.0
- old
+ new
@@ -3,13 +3,10 @@
class Pdf
include Enumerable
attr_reader :path
- # ghostscript prints out a warning, this regex matches it
- WarningRegex = /\*\*\*\*.*\n/
-
# Raises an error if pdf not found and sets some instance
# variables if pdf is found.
#
# path - A String or Path to the pdf
#
@@ -28,11 +25,10 @@
#
# Returns an Integer.
#
def count
@count ||= begin
- result = SafeShell.execute("gs", "-dNODISPLAY", "-q", "-sFile=#{@path}", File.expand_path('../../../lib/pdf_info.ps', __FILE__))
- result.gsub(WarningRegex, '').to_i
+ Grim.processor.count(@path)
end
end
# Creates an instance Grim::Page for the index passed in.
#
\ No newline at end of file