RAW print mode not working..

  • Thread starter Thread starter Steve Alpert
  • Start date Start date
S

Steve Alpert

In a simple test program, I'm trying to print in RAW mode to a printer using the
following template. If I use RAW, and pause the printer, I can see an entry in
the queue but nothing comes out. The data is plain text. If I change to TEXT
mode, the text prints. I'm printing to an attached (old) HP LJ4.

Any ideas?
/steveA

========= Template of code =============

OpenPrinter( szPrinterName, &hPrinter, NULL )

// Fill in the structure with info about this "document."
DocInfo.pDocName = "My Test Document";
DocInfo.pOutputFile = NULL;
DocInfo.pDatatype = "RAW"; <<== with TEXT, it works

StartDocPrinter( hPrinter, 1, (LPBYTE)&DocInfo )
StartPagePrinter( hPrinter )
WritePrinter( hPrinter, lpData, dwCount, &dwBytesWritten )
EndPagePrinter( hPrinter )
EndDocPrinter( hPrinter )
ClosePrinter( hPrinter )
 
Hi Steve,

try setting "DocInfo.pDatatype =NULL;".
In my working code I don't use StartPagePrinter() and EndPagePrinter().
Check generated SPL-File in "system32\spool\printers"-Path, with stopped
printer. It should contain exactly what you have
send to the spooler with WritePrinter.
Did you send a formfeed or job-ending-sequence using PJL/PCL-Codes when
printing to Laserjet Printers ?

Dieter
 
Dieter:
Thanks for your help. I nulled pDatatype and included a trailing FF. I believe
the problem was the missing formfeed. In the old StartDoc..EndDoc strategy, you
didn't have to include the trailing FF. Is there anything I can get from the
device characteristics that say I need one? I noticed the print driver was set
to RAW. I tried the RAW[FF Auto] but that didn't seem to help either. I don't
want to drive extra paper through the printer if I don't have to. I would have
thought the Start/EndPagePrinter would have taken care of this.

/steveA
 
Hi Steve,

I think any printer should accept a FF without an extra page (exception the
last CR LF caused a new page).
RAW[FF Auto] is an option for winprint-Printprocessor (reading raw-Data from
Spoolfile, appending FF if needed and
sending the result to port monitor). You will not see the appended character
in the SPL-File, but if you redirect the printer
output to a file (add a port to "Local Port" with fixed filename e.g.
c:\temp\output.pcl), you detect an appended character.
Take a look at Windows DDK (download from Microsoft). "genprint" is an
example for a print processor (raw.c).
But my version 2600 does not have a RAW[FF Auto] mode. Perhaps newer version
will have.
I don't know a device characteristic, which can help.
An extra <FF> could be necessary, if the raw-Data (PCL or Text) does not end
with "<ESC>%-12345X" or FF.

Dieter
Steve Alpert said:
Dieter:
Thanks for your help. I nulled pDatatype and included a trailing FF. I
believe the problem was the missing formfeed. In the old StartDoc..EndDoc
strategy, you didn't have to include the trailing FF. Is there anything I
can get from the device characteristics that say I need one? I noticed
the print driver was set to RAW. I tried the RAW[FF Auto] but that didn't
seem to help either. I don't want to drive extra paper through the
printer if I don't have to. I would have thought the Start/EndPagePrinter
would have taken care of this.

/steveA
Hi Steve,

try setting "DocInfo.pDatatype =NULL;".
In my working code I don't use StartPagePrinter() and EndPagePrinter().
Check generated SPL-File in "system32\spool\printers"-Path, with stopped
printer. It should contain exactly what you have
send to the spooler with WritePrinter.
Did you send a formfeed or job-ending-sequence using PJL/PCL-Codes when
printing to Laserjet Printers ?

Dieter
 
Back
Top