How to create table with prawn gem in SketchUp using ruby

Hi All,

While I creating a table with prawn gem in SketchUp using ruby, I got an error like,
Error: #<NoMethodError: undefined method 'table' for #<Prawn::Document:0x0000000d5e0210>>

Here is my Code:

Prawn::Document.generate("#{path}", :page_size => "A4", :page_layout => :landscape) do
  text "<b>Space Name - #{@@spa_name}</b>",:size=>12, :align=>:center, :width=>400, :inline_format=>true
  move_down 5
  text "<b><u>#{@@filename}</u></b>", :inline_format=>true
  move_down 2
  image "#{Prawn::DATADIR}/images/#{@@filename}.png", :position => :left, :width => 550, :height => 450

  bounding_box([-10, cursor + 20], :width=>660, :height=>135) do
    pad(5) {
      indent(5, 0) do
        text "<b>CARCASE SPECIFICATION</b>", :size=>10, :align=>:left, :inline_format=>true
      end
    }
    stroke_horizontal_rule

    table([ ["this is the first row"], ["this is the second row"] ])

    pad(5){
     indent(5, 5) do
      bounding_box([0, cursor], :width => 140) do
    	  pad(5){indent(5, 5) do text "<b>BASE/TALL UNIT CORE DETAILS:</b>", :size=>7, :inline_format=>true 
          end }
          stroke_bounds
      end
     end
    }

    transparent(1) { stroke_bounds }
  end
end

Please check and let me know if have any solutions

Thanks,
Siva S

  1. Step to do:
    Maybe the method just doesn’t exist? Have you already checked whether it mentioned in the docs?
    Method List
  1. Step to do:
    I believe nobody else here uses prawn. Prawn has a dedicated support group that you should use instead for further questions about prawn.
1 Like