wicked pdf side issue

南笙酒味 提交于 2019-12-06 14:58:24

问题


I'm exporting a table using wicked pdf

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

Here is the print view

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

Here is the pdf that I'm getting

I want this on the left side but is not working

I tried and nothing:

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

Please somebody can help me?


回答1:


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

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

As arieljuod said you must do that.



来源:https://stackoverflow.com/questions/24461462/wicked-pdf-side-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!