I used these settings
WickedPdf::config = {
:layout => 'application.pdf.html',
:wkhtmltopdf => '/bin/wkhtmltopdf',
:orientation => 'Portrait',
:page_size => 'A4',
:dpi => '300',
:print_media_type => true,
:no_background => true,
:margin => {:top => 0,
:bottom => 0,
:left => 0,
:right => 0},
}
and set the body style
body {
margin: 0;
padding: 0;
background-color: #FFF;
width: 210mm;
height: 297mm;
}
and div of class .page
.page {
display: inline-block;
clear: both;
border: 2px solid #FF0000;
width: 210mm;
height: 297mm;
page-break-after: auto;
}
but when pdf is created, div.page is almost half the pdf page.
source
share