0

I am trying to print a Invoice using default window.print()

Problem: Invoice is printing fine but footer is not printing on bottom of printed page as same as original invoice.

i want: footer should come at the bottom in every condition on first or last page(in case of long invoice)

If invoice is lengthy then footer should come on the last page bottom.

JS fiddle:

http://jsfiddle.net/bsjmq1pp/

I am using Twitter Bootstrap layout

invoiced sample code https://github.com/sitepointweb/bootstrap-invoice/blob/master/sample-invoice.html enter image description here

Naresh
  • 2,761
  • 10
  • 45
  • 78

2 Answers2

0

Try this

@media print {
    .invoiceFooter {
        position: fixed;
        bottom: 0;
    }
}

EDIT #

Just found this SO Question, Print header and footer on every page

Community
  • 1
  • 1
Billy
  • 2,448
  • 1
  • 10
  • 13
0

This code will help you.
Make footer always bottom:

DEMO: http://jsfiddle.net/bsjmq1pp/2/

HTML

<body>
  <div id="wrapper">
    <div id="header"></div>
    <div id="content"></div>
    <div id="footer"></div>
  </div>
</body>

CSS

html,
body {
margin:0;
padding:0;
height:100%;
}
#wrapper {
min-height:100%;
position:relative;
}
#header {
padding:10px;
background:#5ee;
}
#content {
padding:10px;
padding-bottom:80px; /* Height of the footer element */
}
#footer {
width:100%;
height:80px;
position:absolute;
bottom:0;
left:0;
background:#ee5;
}

For old browser add this:

<!--[if lt IE 7]>
<style type="text/css">
  #wrapper { height:100%; }
</style>
<![endif]-->