2

I am developing a web application which is displaying pdf files in web browser and i want to put restrictions on printing this document.Is there any way to stop printing to file as i need to print through physical printer only.

User0806
  • 23
  • 3
  • Possible duplicate of http://stackoverflow.com/questions/6647392/how-to-stop-user-from-printing-webpages-using-javascript-or-jquery – Krishnakant Jul 08 '16 at 05:31
  • Why does it matter? If the user gets a physical hard copy, which you say is allowed, then they can always scan it. – nnnnnn Jul 08 '16 at 05:47
  • Since printing is done by user's machine,i think web application won't be able to meet my requirement..and yes scanning can also be done..is there any other way to maintain security of pdf files? – User0806 Jul 08 '16 at 07:27

2 Answers2

0

Since PDF can be downloaded to computer and than opened with any PDF reader, it means you can't prevent certain functionality of ALL readers.

You still can have your own interface that allows or disallows some functions, but I think printing to file is also browser stuff that can't be controlled using JS.

Justinas
  • 41,402
  • 5
  • 66
  • 96
0

go through css3 media queries in MDN. You must find print media type in the page. It has some restrictions on page printing. https://developer.mozilla.org/en-US/docs/Web/CSS/@media or https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started/Media

Mr_Perfect
  • 8,254
  • 11
  • 35
  • 62