I am not familiar with PowerBuilder at all. We have a problem in our application that is built in powerBuilder 12.
The application calls a WCF service written in .Net. The service returns path of a document that it downloaded.
Is there a way I can print the document without opening it in PowerBuilder? Once the service returns the path, I need to print the document in the default printer.
Any help greatly appreciated.
thanks
You can hook up one of the standard Windows API calls
ShellExecuteOnce you have done this, you can send your path/file to this function and tell it to print, like so:
The return code can be a number of values, but anything greater than 32 means success. Lower values dictate an error, which you can get descriptions for off of MSDN.
One of the ‘pre-reqs’, if you will, is that you will have to have the proper application installed and registered for the file extension of the file you’re passing in for this to work.
And, just FYI, we seem to always have problems with “.txt” files. They never work through this call.