1

Unlike a few other articles, this is not an issue with window.print() not working in Opera. It does work. Whether I navigate to File->Print or call window.print(), a print dialog box opens. The problem is the output is not correct. Specifically, an image is supposed to print out but only a piece of it is printed. This is only happening in Opera. If I use window.print(), the above problem occurs. If I use File->Print, again, the same problem occurs. However, if I turn on Opera's Print Preview option, then File->Print, it prints out the image flawlessly. I don't get it.

FYI, (important), I'm using a separate stylesheet for printing.

Thank you very much.

UPDATE

I did find a line in the print stylesheet that is having a great affect on this problem:

html { background-color : #FFFFFF; }

When not commented out, the output displays in the Print Preview. Then, I do File->Print and it prints out correctly. But it does not print after initiating window.print().

When commented out, the output does not display in the print preview. Then, I do File->Print and it does not print out correctly or at all. But it does print after initiation window.print().

I'm not sure what to do from here.

UPDATE 2

Here is a simplified version of the code that still does not print correctly from File-> Print, but it prints correctly with Print Preview. It should print 3 pages, but File->Print only prints the first page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
    <style type="text/css" media="screen">
      #Content {
        height: 250px;
        width: 25%;
        overflow-y: auto;
      }
    </style>

    <style type="text/css" media="print">
      #Content {
        height: 100%;
        width: 100%;
      }
    </style>    
  </head>

  <body>
    <div id="Content">
      <img src="http://i00.i.aliimg.com/photo/v0/247580968/GPS_software_GPS_schematic_diagram.jpg" /><br />
      <img src="http://i00.i.aliimg.com/photo/v0/247580968/GPS_software_GPS_schematic_diagram.jpg" /><br />
      <img src="http://i00.i.aliimg.com/photo/v0/247580968/GPS_software_GPS_schematic_diagram.jpg" />
    </div> 
  </body>
</html>

Does anybody have any suggestions, solutions, or workarounds to this problem? Anything at all would be really appreciated, even if it's not exactly the right answer.

user717236
  • 4,959
  • 19
  • 66
  • 102

0 Answers0