Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HP 20ps printer doesn't work with my c++ code.

0 views
Skip to first unread message

Richard Yu

unread,
Sep 4, 2003, 5:11:03 PM9/4/03
to
I use the following code for PS printing, it works well with my 2 other
network printers, p8200 and hp 4500
GetDefaultPrinter(PrinterName, &BytesCopied);//ok
port=PrinterName;

aPrinterName=PrinterName;
aPSList->Add(" 350 30 moveto ");
aPSList->Add("("+aPrinterName+")"+" show");
aPSList->Add("showpage");

buffer = (char *)malloc(PRINT_BUF_SIZE);

OpenPrinterA(port, &printer, NULL);
di.pDocName ="";// wbuf;

di.pOutputFile = NULL;
di.pDatatype = TEXT("RAW");
StartDocPrinter(printer, 1, (LPBYTE)&di);


for(int i=0;i< aPSList->Count;i++)
{
aLine=aPSList->Strings[i]+" \r\n";
buffer=aLine.c_str();
WritePrinter(printer, (LPVOID)buffer, aLine.Length(), &written);
}

EndDocPrinter(printer);
ClosePrinter(printer);


but when I switch to the HP 20ps USB printer, can't print any thing, I also
tries using ghostscript 's tool , gview, no printer action.

but other apps like wordpad, can print with selection of (HP DesignJet 20PS
by HP only), I have checked in the code, the printer name I got is right,

HP 20ps is a inkjet UBS, PS emulation printer,

I have tried HP 2600 inkjet network printer, it's an ps emulation printer
too, my code works on it.

what could be the cause ? the USB ? the 20PS specific property ?

this 20ps printer, after installation, you can see in the control panel, two
icons related to 20ps, one is HP DesignJet 20PS by HP (this works with
wordpad...)

the other is hp designjet 20ps RIP, I have tried them both, nothing
happened, RIP is another tool that can accept loading printing job by
dragging ,


Vladimir Afanasyev

unread,
Sep 5, 2003, 3:38:07 AM9/5/03
to

Hi,
May be different level of emulation.
In one case it may be do printer in another case may be driver.
WritePrinter sends data to printer directly by definition.
Try to find printers description on hp site.
Vladimir.

Luiz Rafael Culik Guimaraes

unread,
Sep 5, 2003, 10:30:15 AM9/5/03
to

Richard

Got same problem that you has with usb printers,
is their an how to on how to send Raw data to usb printers

Regards
Luiz

0 new messages