我有一个ExportPdf类,它继承了像这样的Prawn :: Document -
class ExportPdf < Prawn::Document
def initialize(vehicles, view, page, *args)
super({:top_margin => 70, :page_size => 'A1'})
@view = view
@page = page
file_heading
table_data
end
def table_data
move_down 30
table table_data_rows do
row(0).font_style = :bold
self.row_colors = ["DDDDDD", "FFFFFF"]
self.header = true
end
But I have atleast 20 table columns and the only way to accommodate is by increasing page size as,
:page_size => 'A1'.
但这会使其无法打印,因为无法再以A4布局进行打印。如何减小字体大小或容纳所有20个表格列并能够以A4格式打印?
答案 0 :(得分:0)
您可以使用/添加cell_style
示例:
:cell_style => { :size => 10,:border_color => "FFFFFF",:text_color => "333333", :padding => 0, :inline_format => true}
更改大小值以更改表格文本的字体大小。