🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Printing problem to non A4 Paper

#8815
From: Mark Jacobs
Date: Sat, 18 Sep 2004 10:54
52 lines
3113 bytes
Does any of this stuff help?

  int twipinch=1440; TFormatRange wmgc; RECT rendrct,pagerct;
  int phywid=GetDeviceCaps(Printer()->Handle,PHYSICALWIDTH);
  int phyhei=GetDeviceCaps(Printer()->Handle,PHYSICALHEIGHT);
  int xppi=GetDeviceCaps(Printer()->Handle,LOGPIXELSX);
  int yppi=GetDeviceCaps(Printer()->Handle,LOGPIXELSY);
  pagerct.left=0; pagerct.top=0; rendrct.left=0; rendrct.top=0;
  pagerct.right=phywid*twipinch/xppi; pagerct.bottom=phyhei*twipinch/yppi;
  rendrct.right=pagerct.right-twipinch*2;
rendrct.bottom=pagerct.bottom-twipinch*3;
  wmgc.hdc=Printer()->Handle; wmgc.hdcTarget=Printer()->Handle;

-- 
Mark Jacobs

"Eugene" <eugene@dmx.de> wrote in message
news:414bf302$1@newsgroups.borland.com...
|
| Hi there,
|
| I wrote a small program and it uses this procedure for printing.
|
| Printer()->Title = "PrintOut";
| Printer()->BeginDoc();
| Printer()->Canvas->Font->Size = 10;
| Printer()->Canvas->TextOutA(1600,205,"3887");
| Printer()->Canvas->TextOutA(1500,280,"Adams Hoop");
| Printer()->Canvas->Font->Size = 12;
| Printer()->Canvas->TextOutA(1450,375,Edit1->Text);
| Printer()->Canvas->TextOutA(770,375,"# "+Edit2->Text+" #");
| Printer()->Canvas->TextOutA(1100,480,Edit6->Text);
| Printer()->Canvas->Font->Size = 10;
| Printer()->Canvas->TextOutA(250,525,"+Edit3->Text+" .-
| "+ComboBox1->Text);
| Printer()->Canvas->TextOutA(250,570,Edit4->Text);
| Printer()->Canvas->TextOutA(350,620,Edit5->Text);
| Printer()->Canvas->TextOutA(320,670,IntToStr(Day));
| Printer()->Canvas->TextOutA(430,670,IntToStr(Month));
| Printer()->Canvas->TextOutA(520,670,IntToStr(Year));
| Printer()->EndDoc();
|
| It works great but there is a small problem with it.I'm using
| Lexmark 2380 plus for printing and I'm using A5 papers(210x148
| mm, half of A4 210x297 mm).When i print first document and load
| second paper, it ejects the second paper.Then i load it again
| it accepts.I think it is caused that i can not define the
| default paper to A5.It still takes it as A4.
| So how can i solve it?
|
|
| Eugene
Technical Details
Message-ID: <414c13e6@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <414bf302$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2caadd0673962b31
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mark Jacobs" <mark@losethisbitjacobsm.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <414bf302$1@newsgroups.borland.com>
Subject: Re: Printing problem to non A4 Paper
Date: Sat, 18 Sep 2004 11:54:15 +0100
Lines: 53
Organization: DK Computing
MIME-Version: 1.0
Content-Type: text/plain;
 charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 81.86.186.94
Message-ID: <414c13e6@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1095504870 81.86.186.94 (18 Sep 2004 03:54:30 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail