bin/pdf2ruby in origami-1.0.2 vs bin/pdf2ruby in origami-1.0.3
- old
+ new
@@ -98,12 +98,12 @@
obj.value.to_s
when Origami::String
"'#{obj.value.gsub("'","\\\\'")}'"
when Origami::Dictionary
customtype = nil
- if obj[:Type] and @@dict_special_types.include?(obj[:Type].value)
- customtype = @@dict_special_types[obj[:Type].value]
+ if obj[:Type] and Origami::DICT_SPECIAL_TYPES.include?(obj[:Type].value)
+ customtype = Origami::DICT_SPECIAL_TYPES[obj[:Type].value]
end
dictionaryToRuby(obj, inclevel, internalname, customtype)
when Origami::Array
arrayToRuby(obj, inclevel, internalname)
when Origami::Stream
@@ -257,15 +257,15 @@
end
code
end
-colorprint "[*] ", Colors::RED
+Console.colorprint "[*] ", Console::Colors::RED
puts "Loading document '#{TARGET}'"
verbosity = @options[:verbose] ? Parser::VERBOSE_INSANE : Parser::VERBOSE_QUIET
target = PDF.read(TARGET, :verbosity => verbosity)
-colorprint "[*] ", Colors::RED
+Console.colorprint "[*] ", Console::Colors::RED
puts "Document successfully loaded into Origami"
Dir::mkdir(TARGET_DIR) unless File.directory? TARGET_DIR
fd = File.open(TARGET_FILE, 'w', 0700)
@@ -293,26 +293,26 @@
#
#{DOCREF} = PDF.new
RUBY
-colorprint "[*] ", Colors::RED
+Console.colorprint "[*] ", Console::Colors::RED
puts "Retrieving all indirect objects..."
roots = target.root_objects
roots.each do |obj|
varname = "obj_" + obj.no.to_s
@var_hash[obj.reference] = varname
end
-colorprint "[*] ", Colors::RED
+Console.colorprint "[*] ", Console::Colors::RED
puts "Retrieving the document Catalog..."
catalog = target.Catalog
@var_hash[catalog.reference] = "#{DOCREF}.Catalog"
@obj_route.push "#{DOCREF}.Catalog"
-colorprint "[*] ", Colors::RED
+Console.colorprint "[*] ", Console::Colors::RED
puts "Processing the object hierarchy..."
@current_idx = 0
while @current_idx != @obj_route.size
varname = @obj_route[@current_idx]
obj = target[@var_hash.index(varname)]
@@ -344,10 +344,10 @@
#
#{DOCREF}.save(OUTPUT)
RUBY
-colorprint "[*] ", Colors::RED
+Console.colorprint "[*] ", Console::Colors::RED
puts "Successfully generated script '#{TARGET_FILE}'"
fd.close
exit