-1

am currently trying to print an html page and it works fine for the content that's in view when you print it. My main issue is the rest of my html is being cut off at the sections that are not in view. I have added angularprjnt to my project as well as the print css to keep my html page structure.

So my question is, can any one suggest a better method of me printing my page out rather the "window.print();" as I want the html page to divide into multiple pages if it's too long.

  • The page isn't being cut off because of `window.print`. It is being cut off because of some combination of the markup and CSS. Using a different mechanism to tell the browser to print the page won't help. – Quentin Nov 02 '17 at 14:18
  • 1
    If you want a lot of control over the printed page, you might want to consider using [CSS for print media](http://edutechwiki.unige.ch/en/CSS_for_print_tutorial). – lurker Nov 02 '17 at 14:20

1 Answers1

0

You can use CSS to do that with page-break-after

@media print {
    .last-element-on-page {page-break-after: always;}
}

In html add this class to the element you want to be last visible on the page:

<div class="last-element-on-page">Footer</div>
Przemek Marcinkiewicz
  • 1,267
  • 1
  • 19
  • 32