Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing option

Status
Not open for further replies.

rudyboy

Programmer
Oct 16, 2003
49
PH
Hi everyone,

Is it possible programatically to check if the printer that I will be used for printing is turned on? can you show me a sample code.

Second, my system will print on 2 kinds of printer; dot matrix and laserjet. Programatically, can i force powerbuilder to print a report to a dot matrix or laserjet?How can I do this?

Thanks
 
Some ways for doing that:
-If the printer is in a Port (LPT or COM) you can try write to them and check the result.
Example:
FileOpen( "LPT1",StreamMode!,Write!,Shared!)
check the return value for success or unsuccess
See also PrintGetPrinter ( ) for printer ports

-You can see also if the printer as a way to access his properties (in the printer manual).

-You can also search for driver use for thar purpose (I don't know how to do that).
This is reasonable if you use just 2 kind of printers. For n different printer, problably, you have n different ways to check that (I think...).

-Another solution is use the Powerwhizz printer utility ( See the site for details.

-Check also the GetPrinter() API function.


For the second question I don't know if that is possible, unless you can access the printer properties (with one of the previous solutions...)


Hope that helped
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top