🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TPrinter Problem

#15126
From: Remy Lebeau (TeamB)
Date: Wed, 16 Jul 2003 06:09
36 lines
2379 bytes
"Anthony" <awhitesell@attbi.com> wrote in message
news:3f14d673$1@newsgroups.borland.com...

> I am printing on address labels that are 1 inch tall.  When
> I issue Printers()->NewPage() the printer feeds 10 inches
> of paper skipping 10 labels. But if I issue StartPage(Hndl)
> and EndPage(Hndl) then it increments properly.

That is the same thing that TPrinter:NewPage() does internally:

    procedure TPrinter.NewPage;
    begin
        CheckPrinting(True);
        EndPage(DC);
        StartPage(DC);
        Inc(FPageNumber);
        Canvas.Refresh;
    end;

> I have learned that you cannot mix API and VCL calls when
> printing.  I used Printers()->BeginDoc() and the StartPage(Hndl)
> and the IDE complained that the printer was not currently running.

Which handle are you actually passing to StartPage() in the first place?
Everytime you talk about issues with coding, please ALWAYS post the actual
code in question.

> How do you translate Printers()->Canvas->TextHeight("W")
> into an API call?

TextHeight() call TextExtent() which in turn uses the API function
GetTextExtentPoint32().


Gambit
Technical Details
Message-ID: <3f14eafa@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-05!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f1460f3$1@newsgroups.borland.com> <3f14693d$1@newsgroups.borland.com> <3f1471c0$1@newsgroups.borland.com> <3f147649$1@newsgroups.borland.com> <3f1496ff@newsgroups.borland.com> <3f14c841$1@newsgroups.borland.com> <3f14d673$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,d59131589fe63384
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-15 23:09:30 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f1460f3$1@newsgroups.borland.com> <3f14693d$1@newsgroups.borland.com> <3f1471c0$1@newsgroups.borland.com> <3f147649$1@newsgroups.borland.com> <3f1496ff@newsgroups.borland.com> <3f14c841$1@newsgroups.borland.com> <3f14d673$1@newsgroups.borland.com>
Subject: Re: TPrinter Problem
Date: Tue, 15 Jul 2003 23:09:54 -0700
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 207.175.226.26
Message-ID: <3f14eafa@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1058335482 207.175.226.26 (15 Jul 2003 23:04:42 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-05!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail