首页 文章

邪恶的pdf方面问题

提问于
浏览
0

我正在使用wicked pdf导出一个表

这是使用邪恶的控制器

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

enter image description here

我想在左侧但不能正常工作

enter image description here

我没有尝试过:

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

请有人可以帮帮我吗?

1 回答

  • 0

    是的,如果剩余位置保证金,请尝试以下代码:

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

    正如arieljuod所说,你必须这样做 .

相关问题