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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CAPTURE won' t print more than one copy correctly

Status
Not open for further replies.

jwgrahamjr

Programmer
Dec 12, 2002
28
US
Background info:

Novell 6SP3, clients are using DOS applications in Win98 to print various hardcopy reports. These DOS applications have hardcoded CAPTURE, NPRINT and SPOOL commands in them.

Problem (with example):

The software (I have the source code) issues the following command:

CAPTURE F=2 Q=P2 NT NB C=2

If you don't already know this is simply saying "use form 2, use queue p2 on the default server, no tabs, no banners and 2 copies".
The software redirects regular ASCII output to LPT1 or PRN which is picked up by this CAPTURE command.

For a typical 10 page document, you would expect two copies to be printed. Instead, one copy is printed perfectly. On the second copy, about half of the first page is missing and the rest prints out fine.

I set up a simple test. I tried printing "This is a test" 10 times on separate lines using a C program that printed to LPT1. Using CAPTURE and setting copies=2 this test program printed the first page fine and only printed the word "Test" on the second page. Something is truncating the second page. I then tried setting C=3 with the capture command. With C=3 the third page prints garbled text on the first line and then prints the next 9 lines fine. Bizarre.

This server is using old-style queue based printing (obviously). Everything else seems to be printing fine including printing from the ancient WordPerfect 5.1 from DOS.

Other items of interest
I modified the source code to use SPOOL instead of CAPTURE. Same problem occurred. I also tried redirecting the output to a file and using NPRINT, specifying 2 copies and the same thing happened using NPRINT too.

Any ideas on why the "C=" (copies) part of CAPTURE,SPOOL and NPRINT are not working? Unfortunately unless this client upgrades to windows applications they depend on these old DOS programs to print.
 
You could try adding the timeout parameter, I think it is TI=seconds but not sure. Also watch the print job in the queue - is it a single job or is there a job for each page.

With some trickery, you may also be able to send the printer the correct escape sequence to tell the printer to print 2 copies instead of having NetWare do it.

R.Sobelman
 
rjs,

I tried the timeout parameter and got the same problem...it is a single job.

Your other suggestion is exactly what I needed ... I simply put in a line to capture the printer and sent control characters to the printer to tell it to print 2 copies of everything. I then used spool with the same parameters as capture to spool the print job and then despooled the job and sent another control string to set the printer back to single copy mode. In total this was maybe 4 lines in the program...

I don't know why I didn't think of this because I do a similar thing to set the printer to landscape mode with 11x17 paper and change font size for other types of reports.

Thanks for your suggestions and for putting me back on track.

- John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top