1

I got simple C# program which read data from database and generate simple HTML report page. This page use following style sheet:

<head>
....
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
 rel="stylesheet">
</head><body>   
<div class="container">
<div class="table-responsive">
....
<tr style="background-color:#d5ffc3">
...

It works as expected until I print the report to PDF. In that case, PDF does not contain background colors. It is possible to set somehow the same visual appearance for printing?

Tomas Kubes
  • 23,880
  • 18
  • 111
  • 148

1 Answers1

1

You need to give color and background properties inside print. try this -

    @media print {
   
body {
    -webkit-print-color-adjust: exact; 
}
tr{
  background-color:#d5ffc3 !important;
}
}
Upendra Joshi
  • 603
  • 6
  • 15