1. David Vasconcelos
  2. PowerBuilder
  3. Tuesday, 30 October 2018 12:12 PM UTC

Is there an easy way to prevent or turn off printing.  We have a new requirement in which we need to prevent users from printing from a PowerBuilder app due to security.  Is there an easy way to detect printing and stop it.  Trying to avoid adding code in every place that has the print function called.

Thanks

Dave V.

 

Kim Berghall Accepted Answer Pending Moderation
  1. Friday, 2 November 2018 16:00 PM UTC
  2. PowerBuilder
  3. # 1

You can't prevent a user from printing, but you can perhaps make it more difficult. What if they take a picture with their iPhone and then print that?

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 30 October 2018 18:15 PM UTC
  2. PowerBuilder
  3. # 2

Pre-PB8 there was an undocumented ability to inherit an NVO from 'systemfunctions' and any functions overridden in that object would automagically override the system functions. In PB8 the IDE would abort opening the object so that feature couldn't be used anymore.

Comment
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Tuesday, 30 October 2018 15:59 PM UTC
  2. PowerBuilder
  3. # 3

In addition to the above, you would ideally need to prevent screen snapshots. These come in two forms:

1) Using the ALT + PRTSCRN keystroke combination or PRTSCRN keystroke from the desktop, and
2) Using your cellphone or a camera to photograph the screen image.

There's no way to prevent option #2, but there are tools on the market place to prevent using the platform functions to take a screen snapshot.
        https://windowsreport.com/anti-screen-capture-software/

It all depends on how far you want to take it. 


Later -

Olan

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 30 October 2018 13:41 PM UTC
  2. PowerBuilder
  3. # 4

Hi David;

   The "over-ride" approach would work but .. you would have to over-ride the DW Control Print() method in every DC where its used. Then there is the question of the low level print command usage as well. Not to mention the ALT+PrintScreen or just PrintScreen aspects as well that can capture your PB Apps data for printing.

    The problem sounds simple, but to do a proper job - it may require bits of coding in various places to really curtail this activity. All the way from disabling menu print items, capturing keyboard print activity, changing the default printer to a "Dummy" make sure nothing prints, etc.

    I have done this before in a few Apps here in Canada where the Government App security (either Protected "B" or Protected "C") is required. Its certainly can be a bit of a challenge to not only shut down printing but also screen capture, export, CTRL+C, etc. The problem even gets more compounded in PowerServer where the App is webified. Now you also have to deal with the browser aspects as well.

   Building a secure App is much easier when you design for it. Unfortunately, retrofitting for security will probably involve some refactoring in various areas of your App.

Regards ... Chris

Comment
  1. David Vasconcelos
  2. Tuesday, 30 October 2018 14:03 PM UTC
Unfortunately it would also have to work for Powerserver. Printing from the browser won't be an issue since we will be turning off the browsers menu items using AEM. The print screen and screen copy apps would still be an issue. Since access to the app is restricted we plan on having some "legal" verbiage regarding handling sensitive data but like all things you can't prevent stupid, just do our best to code against it.
  1. Helpful
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Tuesday, 30 October 2018 12:50 PM UTC
  2. PowerBuilder
  3. # 5

You could override the Powerbuilder Print functions.

Comment
  1. David Vasconcelos
  2. Tuesday, 30 October 2018 13:13 PM UTC
Thanks Rene but how or where do you override the Print functions since they are "system" functions.
  1. Helpful
  1. René Ullrich
  2. Tuesday, 30 October 2018 13:37 PM UTC
For classes like datawindow it is good practice to have a base class where all your classes are inherited from. So you only need to override the functions in the base class. In the painter of this class find the function you want to override in the function list, double click it and write your code.

For global system functions you have to write your own global function with same name and parameters as the system function.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 30 October 2018 13:50 PM UTC
Hi Rene;



FYI: Events are processed by the PBVM TOP to Bottom in the inheritance tree. So over-riding their behaviour in a higher level ancestor makes sense and is "Doable" However, the App could have "Over-Ridden" the event at the concrete level already - so you still may require "concrete" level object class changes.



Functions are processed by the PBVM Bottom to Top thus, an over-ride could have already been done anywhere in the object class's inheritance hierarchy already. So it tougher here to use a high level ancestor for controlling behaviour as road blocks may already be present in lower level descendants whose code is executed first.



Regards ...Chris
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.