Click here to Skip to main content
15,357,086 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi team,

I am facing the issue which is when we click on web print is disabled.And I disabled the web print but the issue is when i click on on web print the print dialogue is disappearing instead of the disappearing the dialogue box we can show there empty blank page im trying to do that please help me that.

What I have tried:


@media print {
BODY { display: none !important;}}



by this code im archived the disabling print option,now the thing is to show the blank page when we click on web print please help me
Posted
Updated 9-Apr-20 21:46pm
Comments
Richard Deeming 5-Mar-20 6:05am
   
NB: You're not actually disabling anything; you're just making it slightly harder to print your page.

Users who know what they're doing can still use the browser's developer tools to remove your print-blocking styles, which will let them print the page.

And no, before you ask, you cannot disable the developer tools.
Member 14763849 5-Mar-20 7:06am
   
i need to show the blank page when we click on print instead of showing the print dialouge box.

1 solution

If you set the margin for a page using the code below the header and footers are omitted from the printed page.
<style media="print">
 @page {
  size: auto;
  margin: 0;
       }
</style>
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900