Marcel 57

I'm using a link to print the actual page similar to this:

<a href="javascript:window.print()"><img src="print.gif"></a>

also tried it in some other ways, such as

onClick="window.print()"

But both ways my Browser (Safari) shows me the Content somehow cut with white surfaces over some content, and in PDF Preview only the first Page includes Content. If I print by the Browsers Menu everything is just fine, and then if i click on my button, also everything works fine, until i reload the page.

Did somebody already had the same issues, and how to solve this?

Thanks in advance

Sorry for reposting, but since the Website is already online and running, and i packed much of the CSS, i felt not very comfortable showing all the CSS Files in the leftbar.

To see the Problem you may look at the Website and hit the Printbutton on the bottom.

5 answers

0
points
This was chosen as the best answer

The problem goes away when toggling 'Print Backgrounds' on the print dialog (on or off, doesn't seem to matter)

Try explicitly setting the background of 'body' to white in the print stylesheet, and/or any other elements that have a background setting in the various css files.

Answered about 7 years ago by Clay Hinson
  • Yes that exactly was it! I removed "print" from all stylesheets unless, the basic.css one to prevent the font-style and font-size, but there are no backgrounds defined. I think the problem was the table format. Thanks for the Help Clay! Marcel about 7 years ago
0
points

try using self.print() instead of window.print(). It seems to work better in Safari.

Answered about 7 years ago by Clay Hinson
  • Thanks for reanswering, didnt belived that somebody answers in the moment as i change the Question ;) Marcel about 7 years ago
Marcel 57
0
points

I tried now:

<a href="javascript:self.print()"><img src="print.gif"></a>

But no changes, still the same problem.

Answered about 7 years ago by Marcel
0
points

if you type "javascript:self.print()" in Safari's address bar when your site's loaded, does it work properly? It seemed to when I tried that.

Answered about 7 years ago by Clay Hinson
Marcel 57
0
points

Yes when i do so, it works just fine, just like if i hit print from the Menu. What could be the problem then?

Answered about 7 years ago by Marcel