i am user of dbforum. i am delphi developer and using delphi6. i need to print some data to the multiple printer
how can it be possible to set printer as default from code.
printers may be connected directly to hub or to other computers.
i tried to post this text but i did not find anywhere to write.
i need to control printer i.e to send some test to one printer and some text to another printer. i need to use multiple printer from delphi code. how can it be possible to set default printer from the name of printer (string). if any solution pls help me.
i need to send only a line at a time to the selected printer.
Based on your description, it sounds like you are writing Delphi code, and want to be able to use that code to access multiple printers as streams. If this analysis is correct, then you can use my idea. If my analysis of your problem is bad, please restate your problem.
For a collection of N printers (let's assume two, but that isn't really important) you need to open N file objects and associate each of those objects with one printer. The way that you map the input strings to the printer definition is up to you as the program designer... You can ask the user for digits, for names, or to you can enumerate the Windows printers and ask the user to click on radio buttons or similar controls to select a group of printers. The design you choose will drastically affect how you initialize the file objects, but not how the rest of your code routes text to those file objects.
Once you've initilized the file object, simply use the Write() or WriteLn() functions to send text to them.