>I'm implementing an ActiveX which will allow text editing within the app, but not exporting texts. The texts can be saved, but will be encrypted and not usable outside the app.
>
>So far so good, no problem expected yet. However, the app must allow printing. I need to detect printing via a driver which actually exports into a reusable file (PostScript, PDF), and prevent it.
>
>Is there a way (API?) to detect which printers may require or offer printing into a file? Or should I just check for usual suspects (anything with PDF, Post Script and Generic/Text in the printer name)?
In general I don't think you can do this. For example, you can't prevent someone from installing a 3rd party port redirector and sending a print job anywhere they like.
Even standard network redirection could be tough to handle:
1. User sets up a PDF printer on "Server", gives it a share name of "NetPrint"
2. This printer gets installed on a workstation, as "\\Server\NetPrint". There is no indication in its name that it's a PDF printer driver.
There might be some clue via something like WMI that the remote printer prints to PDF but I wouldn't count on it. Especially if the server computer is Novell, Linux etc.
It's worth pointing out that there are a lot of people with legitimate PostScript printers who will be annoyed if you prevent them creating paper output on them.
Finally, there's little preventing a user from optically scanning paper output into files.
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up