Command To Specify An Existing Printer
Command To Specify An Existing Printer
What is the command to specify an existing os printer? All I see in the docs is DefaultPrinter() which returns the os's default printer. Is there also a command to list the existing printers?
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Command To Specify An Existing Printer
You need to enumerate all of the existing printers (and present a list for the User to choose from). That currently requires API functions. If for Windows OS, try ABBKlaus's Printer Lib for PB:
http://www.purebasicpower.de
http://www.purebasicpower.de
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Command To Specify An Existing Printer
I am developing on Mac OS. No Printer Lib for Mac OS besides PB one?
Re: Command To Specify An Existing Printer
Unless more settings are required, PureBasic's PrintRequester() should be quite sufficient.d2848s29 wrote:What is the command to specify an existing os printer? All I see in the docs is DefaultPrinter() which returns the os's default printer. Is there also a command to list the existing printers?
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel 

Re: Command To Specify An Existing Printer
When looking for MacOS examples which require OS-specific API commands you should always take a look into wilbert's thread [PB Cocoa] Methods, Tips & Tricks which contains a list of links to code examples of many different topics. It also contains a link to this code example which lists all available printers.d2848s29 wrote:Is there also a command to list the existing printers?
Re: Command To Specify An Existing Printer
I would like the code to specify the printer with no dialog box.TI-994A wrote:Unless more settings are required, PureBasic's PrintRequester() should be quite sufficient.d2848s29 wrote:What is the command to specify an existing os printer? All I see in the docs is DefaultPrinter() which returns the os's default printer. Is there also a command to list the existing printers?
Re: Command To Specify An Existing Printer
Thank you!Shardik wrote:When looking for MacOS examples which require OS-specific API commands you should always take a look into wilbert's thread [PB Cocoa] Methods, Tips & Tricks which contains a list of links to code examples of many different topics. It also contains a link to this code example which lists all available printers.d2848s29 wrote:Is there also a command to list the existing printers?
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Command To Specify An Existing Printer
I would hope PrintRequester() is sufficient in most cases, but essentially it is out of the control of your app - you might need to know what the paper size/orientation is for example, to ensure a valid print file is sent.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Command To Specify An Existing Printer
I wanted to use P.B. to write a label printing app with predefined label types to print to dedicated label printer.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Command To Specify An Existing Printer
Using the code Shardik has linked to, you can get a list of all available printers and I imagine you already know which one in that list is the dedicated label printer, so you should be fine from there as Shardik's link also has available paper covered too.I wanted to use P.B. to write a label printing app with predefined label types to print to dedicated label printer.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Command To Specify An Existing Printer
That example does not show how to specify the active printer and set its page attributes. I will dig into Cocoa docs to see if that can be done from P.B. using the CocoaMessage function.IdeasVacuum wrote:Using the code Shardik has linked to, you can get a list of all available printers and I imagine you already know which one in that list is the dedicated label printer, so you should be fine from there as Shardik's link also has available paper covered too.I wanted to use P.B. to write a label printing app with predefined label types to print to dedicated label printer.
-
- Addict
- Posts: 1310
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Command To Specify An Existing Printer
Hi
You could take a look at this thread for windows and Mac.
http://www.purebasic.fr/english/viewtop ... +Module%3A
Regards
cd
You could take a look at this thread for windows and Mac.
http://www.purebasic.fr/english/viewtop ... +Module%3A
Regards
cd
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.