Article View: borland.public.cppbuilder.nativeapi
Article #7299Re: Printing - Escape Sequence
From: Hans Galema
Date: Wed, 16 Feb 2005 14:23
Date: Wed, 16 Feb 2005 14:23
58 lines
2746 bytes
2746 bytes
Thomas J. wrote:
> I want to print labels on a label printer.
On what kind of paper ?
> And the aim should be to print a
> Label A and a Label B. After each second Label the cutter should cut.
So not endless with labels glued on it ?
> I
> assumes taht each label is a page. So I called NewPage().
But then I would assume that every two labels constitute a page.
> But the printer
> will create a new job for each call of NewPage
No it will not make a new job. Just start on a new page.
> and for each new job the
> cutter willl work. So Label A and Label B are not together anymore. (I want
> to print 300 labels).
> The label printer company told me to send the esacep sequence F which is
> 0x00c a form feed. And thats what I try to do for hours and hours.
If you want to send an escape sequence than you have to use
the printer in raw mode. As far as I know you cannot use TPrinter()
for that. A formfeed for TPrinter() is NewPage().
> I found out that another way it is possible to send escape sequnces.
Forget about escape sequences. Use TextOut(X,Y, ...) to make new lines
and use NewPage() as formfeed.
> OpenPrinter(printername, &PrnHandle, NULL);
> if (PrnHandle != NULL) {
> if (StartDocPrinter(PrnHandle,1,(LPSTR)&DocInfo) <= 0)
> Application->MessageBox("StartDocPrinter", "Error", MB_OK);
> printer->EndDoc();
Here you mixed the raw printer with TPrinter(). That seems a
bad idea to me.
> TPrinter* printer = Printer();
> printer->BeginDoc();
> printer->Canvas->TextOut(300, 300, "First page");
> Escape(printer->Canvas->Handle,
You did not show what function Escape() does.
Hans.
Technical Details
Message-ID:
<421357d5$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news.zanker.org!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<42125903@newsgroups.borland.com> <421348ec@newsgroups.borland.com> <42134c55@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,bfc9dd83e27dcf9d X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Wed, 16 Feb 2005 15:23:57 +0100 From: Hans Galema <notused@notused.nl> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Printing - Escape Sequence References: <42125903@newsgroups.borland.com> <421348ec@newsgroups.borland.com> <42134c55@newsgroups.borland.com> In-Reply-To: <42134c55@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 129.125.201.248 Message-ID: <421357d5$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1108563925 129.125.201.248 (16 Feb 2005 06:25:25 -0800) Lines: 58 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news.zanker.org!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail