printing in black and white

Anjali Agarwal 1,386 Reputation points

I need to print the contents between two div tags. The printing is done fine, but somehow if the user checks the "Background Graphics" checkbox in the printing pop up then the background becomes blue which is the actual background color of the web page. Is it possible to force the user to print only in black and white or disable the "Background Graphics" checkbox from the pint pop up? Below is the image of the "Background Graphics" check box that I am talking about:


I also tried putting this in the page:

article {
  -webkit-print-color-adjust: exact;
  background: #222;
  color: #eee;


Below is my div tag:

 The contents needs to be printed. This is just a test.

this is the button that calls the print function:

 <asp:LinkButton Width="130px" Height="50px" ID="print" CssClass="btns" runat="server" OnClientClick="printContent('dvContents');return false;" </asp:LinkButton>

any help will be greatly appreciated.

A set of technologies in the .NET Framework for building web applications and XML web services.
3,374 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Lan Huang-MSFT 27,956 Reputation points Microsoft Vendor

    Hi @Anjali Agarwal ,
    I suggest you modify the printer settings.
    Maybe you can set two buttons, first set the content you need to print to black and white, and then change it back.

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,
    Lan Huang

    0 comments No comments