I have captured the print event for a specific file(.txt extension). Now I want to block this print event request for that specific file. Is there any way to block the printing job for the specific file(extension .txt) programmatically? I'm using Operating System: Windows 10 and implementing in Python Language.
Asked
Active
Viewed 181 times
2
-
How have you "captured the print event"? – Nick Westgate Jun 11 '18 at 01:24
-
1I took help from stake overflow source. "https://stackoverflow.com/questions/15748386/how-to-catch-printer-event-in-python" for capturing print events. – Danish Aug 01 '18 at 06:50
-
As you can see, the Windows print system is complicated and limited if you're processing jobs after printing has started. The best you can do in this situation is check the document name (you should have this because JOB_NOTIFY_FIELD_DOCUMENT is being used) and cancel the job if it contains ".txt". You'll have to do some testing, e.g. Notepad will print with a document name of "file.txt - Notepad" but other apps will use a different name. – Nick Westgate Aug 02 '18 at 04:16
-
Sure, I will try to test it. @NickWestgate – Danish Aug 02 '18 at 12:30