    # File lib/prawn/document.rb, line 129
        def initialize(options={},&block)
           Prawn.verify_options [:page_size, :page_layout, :left_margin,
             :right_margin, :top_margin, :bottom_margin, :skip_page_creation,
             :compress, :skip_encoding, :text_options, :background, :info], options

           options[:info] ||= {}
           options[:info][:Creator] ||= "Prawn"
           options[:info][:Producer] = "Prawn"

           options[:info].keys.each do |key|
             if options[:info][key].kind_of?(String)
               options[:info][key] = Prawn::LiteralString.new(options[:info][key])
             end
           end

           @version = 1.3
           @objects = []
           @info    = ref(options[:info])
           @pages   = ref(:Type => :Pages, :Count => 0, :Kids => [])
           @root    = ref(:Type => :Catalog, :Pages => @pages)
           @page_size       = options[:page_size]   || "LETTER"
           @page_layout     = options[:page_layout] || :portrait
           @compress        = options[:compress] || false
           @skip_encoding   = options[:skip_encoding]
           @background      = options[:background]
           @font_size       = 12

           text_options.update(options[:text_options] || {})

           @margins = { :left   => options[:left_margin]   || 36,
                        :right  => options[:right_margin]  || 36,
                        :top    => options[:top_margin]    || 36,
                        :bottom => options[:bottom_margin] || 36  }

           generate_margin_box

           @bounding_box = @margin_box

           start_new_page unless options[:skip_page_creation]

           if block
             block.arity < 1 ? instance_eval(&block) : block[self]
           end
         end