0

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

enter image description here

I want this on the left side but is not working

enter image description here

I tried and nothing:

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

Please somebody can help me?

Carlos Morales
  • 1,137
  • 3
  • 15
  • 38
  • maybe "0" is not a valid value for the page, try using a small value but not 0 – arieljuod Jun 29 '14 at 17:38
  • 1
    I meant a positive small number, like 1 or 0.1, I don't know what are the valid values for margin on wicked_pdf, maybe you need to specify some measure unit like pt or px too – arieljuod Jun 29 '14 at 18:21

1 Answers1

0

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.

Charlie Brown
  • 219
  • 3
  • 10