🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to use postscript inside BCB to print graphics ?

#14853
From: Richard Yu
Date: Mon, 28 Jul 2003 19:29
51 lines
2542 bytes
this is my test program,  the printer has no reaction, what's wrong whith me
?


void __fastcall TForm1::PSTestClick(TObject *Sender)
{

   BOOL   RetCode = FALSE;
   HANDLE Printer = NULL;
   LPTSTR aName="Xerox Phaser 8200DX";
   LPCSTR Str="test me";
   if (OpenPrinter(aName, &Printer, NULL))
   {
      DWORD      Jobid    = 0;
      DOC_INFO_1 DocInfo  = {0};

      DocInfo.pDocName    = "The Document Name";
      DocInfo.pOutputFile = "ffff";
      if ((Jobid = StartDocPrinter(Printer, 1, (LPBYTE) &DocInfo)) != 0)
      {
         DWORD Written;
         DWORD NumBytes = lstrlen(Str);

         WritePrinter(Printer, (void*) Str, NumBytes, &Written);

         if (Written == NumBytes)
            RetCode = TRUE;
      }

      EndDocPrinter(Printer);
      ClosePrinter(Printer);
   }
}


"Vladimir Afanasyev" <avv@systema.kiev.ua> wrote in message
news:3f255bd6$1@newsgroups.borland.com...
>
> Hi,
> "Richard Yu" <richard@colorselector.com> wrote:
> >I like to print graphics directly use Postscript operator inside BCB, how
to
> >do it, and what libraries, dll are required ?
> >thanks.
>
> If your printer is Poscript printer you can use WritePrinter
> Win32 API function for direct sending Postscript operator to
> printer:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;138594
>
> Vladimir.
Technical Details
Message-ID: <3f257a84$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-05!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!green.readfreenews.net!news.readfreenews.net!news-xfer.cox.net!peer01.cox.net!cox.net!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
References: <3f2554be$1@newsgroups.borland.com> <3f255bd6$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,434d7e072e9595a
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-28 12:35:11 PST
From: "Richard Yu" <richard@colorselector.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References:  <3f2554be$1@newsgroups.borland.com> <3f255bd6$1@newsgroups.borland.com>
Subject: Re: How to use postscript inside BCB to print graphics ?
Date: Mon, 28 Jul 2003 12:29:59 -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: <3f257a84$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1059420804 24.207.7.224 (28 Jul 2003 12:33:24 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-05!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!green.readfreenews.net!news.readfreenews.net!news-xfer.cox.net!peer01.cox.net!cox.net!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