🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #14013

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

#14013
From: Richard Yu
Date: Thu, 04 Sep 2003 21:11
51 lines
2736 bytes
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 ,
Technical Details
Message-ID: <3f57aa76$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!newshosting.com!news-xfer2.atl.newshosting.com!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,bb667f613de42596,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-09-04 14:12:25 PST
From: "Richard Yu" <richard@colorselector.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: HP 20ps printer doesn't work with my c++ code.
Date: Thu, 4 Sep 2003 14:11:03 -0700
Lines: 53
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 24.207.7.224
Message-ID: <3f57aa76$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1062709878 24.207.7.224 (4 Sep 2003 14:11:18 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!newshosting.com!news-xfer2.atl.newshosting.com!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail