Link to home
Start Free TrialLog in
Avatar of memberksa
memberksa

asked on

Script to print a large file from command line

We are using windows 2000 client as print server and a zebra barcode printer. This printer will print only when there is object infront of it other wise it will not. We have
a large file (to print lables on 5000 cartons) and this total printing time is supposed to be 12 Hrs. We wnat when the job is given to be printed we should not get any error in case printer is busy or printer memory is full. We should get errors only if printer is not functioning.
Avatar of bhagyesht
bhagyesht
Flag of India image

memberksa: We did something very similar but it was for another printer. this is how we went about it. Our printer had an RS232 connection and we could connect to the printer via the MSCOMM control we used to send to the printer data via the port after checking the status of the printer. you can try the same if your printer allows you.
if your printer has a windows driver then you can check the status of the printer driver by using the Printing and Print Spooler Functions you can search in msdn for "Printing and Print Spooler Functions"

this link also provides u some information
http://www.merrioncomputing.com/Programming/PrintStatus.htm
Avatar of memberksa
memberksa

ASKER

The printer is connected through 10Mbs TCP/IP (card is supplied by Zebra). Using serial port may not be practically viable b'caz
1) the distance between the printer and system is 100 Meters + (on production line and due environmental resons we cannot have  a computer on production line).
2) Secondly if we are going to sense the status of the printer by polling then in thime interval polling is made and system responds with commods to printer for printing there may be cartoons on production line which will go without a lable and this will be a disaster.
Presently we are able to sent 1200 labels at one go but we want to increase it to 5000.
In addition to the above comments if it can be gaurenteed that
if i split the printing job into more than one job and submit it for printing then the printer queue should submit them to printer as and when the printer is ready to accept new jobs and at same time should not result in any error messages.
does the printer have a windows printer driver? if yes then you can check if the printer memory is full or not if its not send data to printer of its full check again after 1 second or so. I suppose 1 seconds is not a large time. and the printer should responds in one second. so max 1+1=2 seconds to wait before sending data to the printer when the printer's memory is not full
when the printer's memory is not full : still means that the the printer is having work to do and is not idle since if it has a 2mb memory and the memory is 1.8mb with data you shall get memory not full so u can send jobs
1) We are using generic text driver and sending commands to printer in printer language (ZPL)
2) The memory free which is given by the utilities may not be exact memory free as processing of labels takes more memory than the storage of formats. Memory free give memory free after storage of formats and not after processing of formats.
I am not sure processing of labels takes memory. anyway this is as far as I can go. how about just keeping on sending data to the printer if the memory is full an error occurs check if the error is due to full memory if so ignore it?
The suggestion does not work
ASKER CERTIFIED SOLUTION
Avatar of bhagyesht
bhagyesht
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial