|
-
Aug 24th, 2009, 11:06 AM
#1
Thread Starter
New Member
Printing code or printer driver problem?
It has been a while since I reviewed some printing code in an app of mine, but doing so has resulted in some strange characteristics of printing jobs with code that has been very solid in the past.
I use an API-generated print dialog box to get parameters and set things up and then use the Printer object to print the page. Because of limitations in printer settings and limitations of some printers, I use nested looping to print consecutive pages and to control collating. Because the print job requires 14" special water-marked paper because of what is being printed, the code includes a MsgBox to prompt the user to insert this special paper in the paper slot/printer before continuing with the print job. This makes it easy to trace what is happening in the code when the app runs, althought the same thing can be confirmed running in the environment and stepping through the code. The code in outline form is as follows:
Printer Setup stuff...
For X = 1 to 2 ' total pages of printed document
For Y = 1 to number_of_copies
response& = MsgBox("Insert paper for page " & X)
Select Case X
Case 1
...sends code for 1st page of document
Case 2
...sends code for 2nd page of document
End Select
Printer.NewPage
Next
Next
Printer.EndDoc
Reset printer stuff...
Here's what happens when the code is run:
On an HP Color LaserJet 2605dn, the printer light blinks after the MsgBox prompt is answered and the print job is started, but nothing will print, no matter how long I wait. The NewPage code is sent, because the MsgBox prompt to insert paper for page 2 is seen, but the printer light continues to blink with no further action. If the 2nd MsgBox prompt is answered, the printer then starts and prints both pages without further pause. This printer is on a network connection to the controlling computer.
On an Epson Stylus Color 640 printer connected directly to the controlling computer via LPT1 the following occurs... After answering the first MsgBox prompt, the print job actually starts, but doesn't complete the first page. Approximately 2" of printing is not completed at the bottom of the page. During this process, the 2nd MsgBox prompt is received. If/When the 2nd MsgBox is answered, the first page will complete printing and the 2nd page will print to completion!
This may not seem to be a problem, but the requirement for this form is that both pages be printed front-to-back on the same piece of paper. That is another reason for the MsgBox prompts. The user can insert the water-marked paper for printing the first page, wait until that page is completed, then because of the 2nd MsgBox prompt, the print job (supposedly) will wait until the first page is completed printing and the user can take the same page, reverse it and replace it in the printer, then answer the 2nd MsgBox prompt to start the completion of the printing job.
The code is being run on an XP machine with version 6.0.98.2 of the run-time files. With these varying results from the same code on different printers, I am wondering if this is possibly due to changes in the run-time files provided by MS in various Windows updates in the last couple of years or if I seem to have some printers with genuinely interesting printer driver issues. In the past, I have actually convinced HP that they had a problem with a specific printer driver, so I know it happens.
Any perspective on this problem would be appreciated.
Ray
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|