🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#14881
From: Richard Yu
Date: Tue, 29 Jul 2003 17:06
69 lines
2520 bytes
and I have a section PS code like this, how and where can I put them into
the C++ code ?

put into the Str =  PS code ?  the str can accept some of the PS symbles.



[/CIEBasedABC << /RangeABC [0 0.9490 0 1 0 1.0798] %std paper wpt

/RangeLMN [0 0.9490 0 1 0 1.0798]

/WhitePoint [0.9490 1 1.0798]


>>] setcolorspace



0.6861 0.6961 0.4639 setcolor %YPTR-V2W2-Y6YW

100 100 60 60 rectfill

showpage



The C code now like this:

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

   BOOL   RetCode = FALSE;
   HANDLE Printer = NULL;
   LPTSTR aName="Xerox Phaser 8200DX";

   LPCSTR Str="test me string";//assign PS here ? how ?
   DWORD err;
   if (OpenPrinter(aName, &Printer, NULL))
   {
      DWORD      Jobid    = 0;
      DOC_INFO_1 DocInfo  = {0};

      DocInfo.pDocName    = "The Document Name";
      DocInfo.pOutputFile = NULL;
      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);
   }
   else
    {
      err=GetLastError();
      if(err==ERROR_INVALID_PRINTER_NAME)ShowMessage("Invalid Printer
Name");
        else ShowMessage("Error:"+IntToStr(err));
    }


}
Technical Details
Message-ID: <3f26aa48@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f2554be$1@newsgroups.borland.com> <3f255bd6$1@newsgroups.borland.com> <3f257a84$1@newsgroups.borland.com> <3f26304d$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-29 10:11:06 PST
From: "Richard Yu" <richard@colorselector.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References:  <3f2554be$1@newsgroups.borland.com> <3f255bd6$1@newsgroups.borland.com> <3f257a84$1@newsgroups.borland.com> <3f26304d$1@newsgroups.borland.com>
Subject: Re: How to use postscript inside BCB to print graphics ?
Date: Tue, 29 Jul 2003 10:06:02 -0700
Lines: 73
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: <3f26aa48@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1059498568 24.207.7.224 (29 Jul 2003 10:09:28 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail