Article View: borland.public.jbuilder.java.api
Article #1154How to set printable area and reduce the margin area
From: Antonio
Date: Thu, 30 May 2002 10:13
Date: Thu, 30 May 2002 10:13
25 lines
1597 bytes
1597 bytes
I have a print routine that draws a rectangle with de width and height of
page:
public int print(Graphics g, PageFormat pf, int pi) throws PrinterException
{
if (pi >= 1)
return Printable.NO_SUCH_PAGE;
Graphics2D g2 = (Graphics2D) g;
g2.setColor(red);
g2.drawRect((int) pf.getImageableX() + 1
,(int) pf.getImageableY() + 1
,(int) pf.getImageableWidth()
,(int) pf.getImageableHeight());
return Printable.PAGE_EXISTS;
}
The problem is that the margin space is too wide in a DIN A4 page...How can
I reduce the margin space?
Thanks
Antonio V�zquez
avazquez@winsoftsystems.com
www.winsoftsystems.com
Technical Details
Message-ID:
<3cf5faa6_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!peer.news.opaltelecom.net!newsfeed.wirehub.nl!skynet.be!skynet.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 1089d0,aff152e741f2b0ed,start X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2002-05-30 03:13:15 PST From: "Antonio" <avazquez@winsoftsystems.com> Newsgroups: borland.public.jbuilder.java.api Subject: How to set printable area and reduce the margin area Date: Thu, 30 May 2002 12:13:08 +0200 Lines: 27 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 62.174.36.109 Message-ID: <3cf5faa6_2@dnews> X-Trace: dnews 1022753446 62.174.36.109 (30 May 2002 03:10:46 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!peer.news.opaltelecom.net!newsfeed.wirehub.nl!skynet.be!skynet.be!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews