html - table background image not display on printing paper -


template.html

{% block css-custom %}     <link rel="stylesheet"  type="text/css" media="print" href="{{ static_url }}style/print.css" />     <link rel="stylesheet"  type="text/css" media="screen" href="{{ static_url }}style/print.css" /> {% endblock %}  {% block main-content %} '''''''''''''' <table width="100%" border="0" class="printimg">              <tr><td>some data</td></tr></table> ''''''''''''''''' {% endblock %} 

i want set above image background table.if set same image in tag in , coming display, background not happening.as html page working,problem printing in paper.

on print preview background image coming display on printing in paper image gets disappeared.

edit:

report.css

.printimg {            background:url('/static/images/human.png');            width:128px;            height:293px;            background-position:center;"           }  /* media:screen */ @media screen { .printimg img{     visibility: hidden; } }  /* media:print */ @media print { .printimg img{     visibility: visible; } } 

i tried css,still same problem their.

1.to enable background printing in chrome , safari web browsers add

-webkit-print-color-adjust:exact; 

in print.css file,rest same

2.in firefox default "print background colours , images" turned off in print settings,no css override that.

user should manually turn on if background image required.

steps turn on background in ff:

go file -->page setup -->formats & options -->tick print background(images & colors) 

hope help!


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -