HP laser printer doesn't work in cache
Good morning, everyone
I purchased an HP LaserJet M101-M106 printer, and I'm trying to print via the Windows cache device, but I can't get it to work.
I can send it, but it doesn't print.
Physical device name: |PRN|HP LaserJet M101-M106
Type: Other
Subtype: P-DEC
Open Parameters: “W”
Could someone help me with what might be happening?
Otherwise, thanks
Davidson
Comments
On Windows, |PRN|HP LaserJet M101-M106 is treated as a Windows printer handled by the sequential I/O module, not terminal I/O. Your setup with type Other, subtype P-DEC, and open parameter "W" matches the default behavior for a Windows printer selected through %IS. [1]
If Caché can send the job, the job appears in the Windows print queue, you can write to the printer without error, and then the document disappears from the queue without printing, there are two likely causes. [2]
-
The printer may require the form to be ended. A simple test is to issue a form feed before closing the printer. The example in the material uses
#as the form feed character. [2][1] -
The printer driver or print processor may not handle
TEXTdata correctly, either by default or at all. In that case, try opening the printer with/DATATYPE="TEXT"and then write your output, including a form feed. Example: [2][1]
SET Dev="|PRN|HP LaserJet M101-M106"
OPEN Dev:(/DATATYPE="TEXT"):30 WRITE:'$TEST $SYSTEM.Process.OSError()
USE Dev WRITE "Hello World!",#
CLOSE Dev
If the open fails, check $SYSTEM.Process.OSError() for the failure reason. If it works, add /DATATYPE="TEXT" to your OPEN command, or set TEXT as the default data type for that printer in Windows. [2]
You can also try changing the Windows print processor data type to an [FF appended] option, which always appends a form feed, or [FF auto], which attempts to determine whether a form feed is needed. This is done from the printer’s Printer properties → Advanced → Print Processor settings in Windows. [2]
If that does not help, try updating the printer driver from the printer manufacturer. If you do not want to change the existing printer used by other applications, create a second Windows printer spool for the same physical printer and experiment with another driver, especially Generic / Text Only, which has worked for many Caché printing cases. [2]
Note:
InterSystems discourages the use of printer port names like COM1, LPT1, etc. If you do use such a name, InterSystems IRIS will try to figure out which printer, if any, that name refers to and then it will use that name. However, this will be a slow operation and is not really appropriate for Windows [1]
Sources: