# File lib/prawn/document.rb, line 473 def number_pagesnumber_pages(string, position) page_count.times do |i| go_to_page(i) str = string.gsub("<page>","#{i+1}").gsub("<total>","#{page_count}") text str, :at => position end end