Currently my web page is full of various text colors but when I try to print the page then all text colors are displaying in black color only. So how can I make so page text displays in original colors (not black fonts & white background) when print / print preview it?
Another thing is that, using below code I am able to hide header, footer from web page during printing but how can I print only specific area of web page instead of entire web page? My page is designed using HTML, CSS, DIV and Bootstrap. So is it possible to do it using PHP or Javascript or CSS? Please help.
CSS Code
<style type="text/css" media="print">
@media print
{
header, .footer, footer { display: none; }
color-adjust: [economy | exact]; // I tried this for color profile but not working
}
@page
{
size: auto;
margin: 0mm;
}
html
{
background-color: #FFFFFF;
margin: 0px;
}
body
{
border: solid 1px black ;
margin: 10mm 15mm 10mm 15mm; /* margin you want for the content */
}
</style>
HTML & Javascript code
<button onclick="window.print()" class="btn btn-lg btn-info"> <i class="fas fa-print"></i> Print </button>
I tried this code in CSS for color option but not working.
color-adjust: [economy | exact];
EDIT#1
I have done following in my CSS and HTML to skip printing of specific data on web page. But not working.
<style type="text/css" media="print">
@media print
{ .noprint{display:none}; }
</style>
<div class="row padding-10 noprint">
<div class="col-md-12" align="center">
This text should not be printed on printer
</div>
</div>