邪恶的pdf侧面问题 [英] wicked pdf side issue

查看:41
本文介绍了邪恶的pdf侧面问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 wicked pdf 导出表格

I'm exporting a table using wicked pdf

这里是使用 wicked 的控制器

here is the controller that use 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

我想要这个在左侧但不起作用

I want this on the left side but is not working

我试过了,一无所获:

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

请问有人可以帮助我吗?

Please somebody can help me?

推荐答案

是的,还有头寸余量,试试这个代码:

Yes tha'ts a position margin left, try this code:

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

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

As arieljuod said you must do that.

这篇关于邪恶的pdf侧面问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆