4

Windows 8/8.1 (Initially problem appeared in 8 so I upgraded to 8.1, but problem persists)

IE 11.0.2

I'm using a product called eTools. It is used to generate and manage character sheets for Dungeons and Dragons gaming. The information is stored in a database file, but to create a character sheet the software uses XLS stylesheets to generate a HTML file. A script then opens the HTML file in IE and initiates the Print command. The user then selects the printer and clicks OK.

The problem is that the following line gets ignored:

<br style="page-break-after: always">

I'm pretty sure that this line is the culprit because if I save the HTML file and print it on a PC with an older version of Windows and IE it works fine.

I have tested various printers, including Adobe PDF printer and all fail on Windows 8/8.1 but work on an older version.

The product works fine on Windows XP, Vista and 7, but it has a problem on Windows 8 and 8.1 x64.

I'm wondering if there is a setting in Windows 8/8.1 or IE11 that I've overlooked?


Edit:

I just took the HTML file created in Windows 8.1 and IE11 and tried to print it on Windows Vista with IE9. It printed fine.

This leads me to think that there is something about IE11 that is causing it to ignore the page-break tags.

Can anyone help me with this?

user3186705
  • 41
  • 1
  • 4
  • 1
    Did you ever find a solution for this problem? I'm having the same issue when aggregating several blobs of HTML, trying tp insert a page-break so each blob prints on its own page. the CSS property was working fine, but is no longer working in IE 11. – Jeff Jul 17 '14 at 16:09
  • 1
    Hi Jeff, yes ` ` ... I added the META command to the header. I chose IE=5.0000 because that was the current version when eTools was written. You might try IE=9.0000 or IE=10.0000 if you need more recent compatibility. – user3186705 Jul 19 '14 at 12:30
  • Thanks! Using a DIV worked for me; didn't need to set the META tag. – Jeff Jul 21 '14 at 00:03
  • show this answer: [enter link description here](https://stackoverflow.com/questions/1630819/google-chrome-printing-page-breaks) – Mahdi Afzal Jul 26 '17 at 07:10

3 Answers3

4

According to http://www.javascriptkit.com/dhtmltutors/pagebreak.shtml the problem may be with using the <br /> element:

Note that page-break-after may not work with <BR> or <HR> tag in some browsers.

Instead, they suggest trying this:

<DIV style="page-break-after:always"></DIV>

Using a div worked nicely for me; hope it helps someone else too.

Jeff
  • 396
  • 3
  • 11
2

Ran into the same issue today in ie11. ie has a couple issues. first it doesn't like the page break inside a <br> but will work fine in a <div> or <p> tag. It then only seems to work if I have content after the page break tag.

like this:

<div style="page-break-after: always;"></div>
<div></div>

This does not work:

<div style="page-break-after: always;"></div>

Unfortunately this creates a blank page at the end every time but I haven't any other way to make it work without it.

Jessica
  • 141
  • 3
  • 6
0

page-break-after doesn't work with a
tag. Try a p or br tag

<p style="page-break-before: always">&nbsp;</p>
GnomeCubed
  • 594
  • 4
  • 14