Kbase 18271: Procedure to Test Printing on Windows 32 Intel
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  17/12/2004 |
|
Status: Verified
GOAL:
How to setup Windows 32 Intel printers correctly and gives guidelines on how to test if they are working.
GOAL:
Guidelines on how to test printers on Windows 32 Intel
GOAL:
How to test printers on Windows 32 Intel?
GOAL:
Setting up the Printers on Windows 32 Intel
GOAL:
Testing Printing with Progress on Windows 32 Intel
GOAL:
Unable to create Printer Device Context. (4110)
FACT(s) (Environment):
Windows 32 Intel
Windows NT 32 Intel/Windows 2000
CAUSE:
Setting up the Printers on Windows 95:
Local Printers:
Install any locally connected printer to its corresponding printerport using the ADD PRINTER (Start > Settings > Printers) program. Set up the printer to do printer spooling in the RAW format and to the correct page size (ex. A4).
Network Printers:
Any network printer will have an UNC name consisting of "\\HOSTNAME\PRINTERNAME". There might also be a printer queue UNC name associated with the printer and this must Not be used.
There are two ways to capture the network printer:
1) Browse through Network Neighborhood and right click on the network printer that should be captured, select capture and enter the port to assign the Network printer. Then the driver for the printer has to be installed. Start the ADD PRINTER program and select local install. Then pick the driver and select the same printer port that the Network printer was captured to.
OR
2) Manually capture the printer with the NET USE command to the port, NET USE LPT3 \\HOSTNAME\PRINTERNAME. Then install the local printer as described above.
This should allow a test page to be printed. If that succeeds then the printers are installed correctly.
Setting up the Printers on Windows NT/2000/XP:
Local Printers:
Install any locally connected printer to its corresponding printer port using the ADD PRINTER program. Set up the printer to do printer spooling in the RAW format and to the correct page size (ex. A4).
Network Printers:
Again, there are two ways to install a Network printer.
1) To install a network printer, first install a LOCAL printer using the ADD PRINTER program. Select which port this printer should be connected to and install the correct driver for the network printer. Then install the network printer and again configure this to have the same port settings as the newly installed local printer.
OR
2) Manually capture the printer with the NET USE command to the printer port. Example, NET USE LPT3 \HOSTNAME\PRINTERNAME.
Then install the local printer as described in the Windows 95 section above.
This should allow a test page to be printed. If that succeeds thenthe printers are installed correctly.
Testing Printing with Progress:
It is important to remember that in later versions some session parameters may have changed, or seem not to be there.
-o LPTX The -o parameter is documented in version 9, but not in V8.2 manuals. -o identifies the printer to use when
processing the OUTPUT TO PRINTER statement in procedures.
This will not prevent you from doing OUTPUT TO LPTX in the same session.
-Wa The -Wa parameter indicates that the parameters following it are windows attributes parameters.**
-Wa -wpplf Enables WPP mode and changes the EOF behavior, making it send only the linefeed at an EOF.
-Wa -wpp Basically bypasses the Windows printer and sends the output directly to the printer.
**Note: You can only use this startup parameter at the command line. It is ignored when used in a .pf file. It must be the
last parameter in the command.
FIX:
Three small examples on how to print follow at the end of this Knowledge Base, but are explained here:
OPRN.P can be used to test if the PRINTER is picked up correctly.
LPRN.P can be used to test if the LPTX is picked up correctly.
PUT-CODE can be used to test if the control codes are printed correctly. This program is also able to test output to a file and directly to a network printer.
It is strongly suggested to use all three programs to test each setting.
The GUI client (prowin32.exe) should be able to run these programs without the need for the parameters, but this can be printer driver dependent so the test should not be skipped.
The Character Client (_progres.exe) will most likely not be able run the PUT-CODE program without the -Wa -wpp setting.
TESTING WITH . Start the program using either:
PROWIN32.EXE -o LPTX or,
_PROGRES.EXE -o TX
Where LPTX is in capital letters and where X (1-9) is the printer port to which the output should go.
TESTING WITH -Wa -wpp. Start the program using either:
PROWIN32.EXE -Wa -wpp Or,
_PROGRES.EXE -Wa -wpp
This is a VERY important setting if the character client is supposed to print any control codes.
**********************************************************************
/* OPRN.P */
OUTPUT TO PRINTER.
DISPLAY "This is the output from OPRN.P".
OUTPUT CLOSE.
**********************************************************************
/* LPRN.P */
OUTPUT TO LPT1.
/*OUTPUT TO LPT2.*/
/*OUTPUT TO LPT3.*/
DISPLAY "This is the output from LPRN.P".
OUTPUT CLOSE.
**********************************************************************
/* PUT-CODE.P */
/* PROGRAM NAME: put-code.p
* DESCRIPTION : This program shows how you can use printer
* escape codes to change attributes on a
* printed report. It must be connected to a sports.db
*/
DEFINE VARIABLE reset AS CHARACTER FORMAT "X(2)" INITIAL "~033E".
DEFINE VARIABLE compress AS CHARACTER FORMAT "X(9)" INITIAL "~033(s16.66H".
DEFINE VARIABLE normal AS CHARACTER FORMAT "X(9)" INITIAL "~033(s10H".
DEFINE VARIABLE landscape AS CHARACTER FORMAT "X(5)" INITIAL "~033&l1O".
DEFINE VARIABLE portrait AS CHARACTER FORMAT "X(5)" INITIAL "~033&l0O".
DEFINE VARIABLE prtmode AS LOGICAL FORMAT "C/N" INITIAL "C".
DEFINE VARIABLE orient AS LOGICAL FORMAT "P/L" INITIAL "L".
DEFINE VARIABLE dfile AS CHARACTER FORMAT "X(20)".
DEFINE STREAM diskfile.
/* Prompt user for output details */
MESSAGE "Select mode for report (Normal or Compressed) "
UPDATE prtmode.
MESSAGE "Select orientation (Portrait or Landscape) "
UPDATE orient.
/*dfile = "\\HOSTNAME\PRINTERNAME".*/
/*dfile = "print".*/
dfile = "LPT1".
/* change above to correspond with the current test*/
OUTPUT STREAM diskfile TO VALUE(dfile).
/* Ask printer to go into requested state for report */
IF prtmode = TRUE THEN
PUT STREAM diskfile CONTROL compress. /* send COMPRESS code */
ELSE
PUT STREAM diskfile CONTROL normal. /* send NORMAL code */
IF orient = TRUE THEN
PUT STREAM diskfile CONTROL portrait. /* send PORTRAIT code */
ELSE
PUT STREAM diskfile CONTROL landscape. /* send LANDSCAPE code */
/* report code */
FOR EACH customer where cust-num < 10:
DISPLAY STREAM diskfile cust-num name.
END.
/* return printer to default state */
PUT STREAM diskfile CONTROL reset.
OUTPUT STREAM diskfile CLOSE.
RETURN. /* return to calling program */
/* end of procedure */