1

だから私は次のコードを持っています:

items = [ ["Photo","Name", "Qty", "Unit Price", "Amount"] ]
items += @quotation.quotation_items.map do |oitem|
[
   pdf.image(oitem.item.photo),
   oitem.item.title,
   oitem.quantity.to_s,
   number_to_currency(oitem.item.price,:unit => 'HK$ '),
   number_to_currency(oitem.full_price,:unit => 'HK$ ')
]

これにより、次のエラーが生成されます。

Content type not recognized: #<Prawn::Images::JPG:0x00000101703b98 @bits=8, @height=300, @width=300, @channels=3, @scaled_width=300, @scaled_height=300>

抽出されたソース (54 行目あたり):

51: 
52: end
53: 
54: pdf.table items, :header => true,
55:                  :column_widths => [300,200,100,150,150],
56:                  :row_colors => ["FFFFFF","DDDDDD"]
57: 
4

1 に答える 1

0

私を大いに助けてくれた画像付きのモックテーブルを見つけました。私たちと共有してくれた jfeust に感謝します。-https ://gist.github.com/973267

于 2011-08-30T04:46:56.107 に答える