Question

I wrote code that simply generates a table gridview. The last column provides a print button option for each record. if the user clicks the print button a pop up window is displayed with background image and three pieces of data. it looks great on the screen but when you print the form, everything will print (data) but the background image. Any suggestions? thanks.

For this issue you can use Frédéric Hamidi solution and change the browser settings or you can do the following with CSS.

wrap your code in div tags and call the background image as an img object. and set the background color to white. for some strange reason this does the trick and users will not need to change the browser settings to print an image.

#container { 

    width:500px; 
    height:393px;
    background-color: #FFFFFF;

}

<div id="container">
<img src="image.png" style="position: absolute;">
<table>
<tr><td>test</td></tr>
</div>
Was it helpful?

Solution

The browser ultimately decides whether or not to print background images. For instance, under Internet Explorer, you need to enable that feature in the Advanced tab of the Internet Options dialog box.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top