0

我正在使用 wicked pdf 导出表格

这是使用 wicked 的控制器

def print_invoice

  respond_to do |format|

    format.pdf{ 
      send_data render(
        ####### WICKED CODE ######
        :pdf => "invoices",
        :margin => {:top=> 0,:bottom => 0,:left=> 0,:right => 0},
        :orientation => "Landscape",
        :print_media_type => true,:disable_smart_shrinking => true)
        )
        ####### END WICKED CODE ######
    }       
  end      
end

这是打印视图

<html>
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>  
<body>
  <table  border="1"  align="left">
  </table>
</body>
</html>

这是我得到的pdf

在此处输入图像描述

我想要这个在左侧但不工作

在此处输入图像描述

我试过了,什么也没有:

 :margin => {:top=> 0,:bottom => 0,:left=> -10,:right => 0},

请问有人可以帮助我吗?

4

1 回答 1

0

是的,这是一个位置边距,试试这个代码:

:margin => {:top=> 0,:bottom => 0,:left=> 0.1,:right => 0},

正如 arieljuod 所说,您必须这样做。

于 2014-06-29T18:35:01.760 回答