🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #1155

Re: How to set printable area and reduce the margin area

#1155
From: Joi Ellis [TeamB]
Date: Thu, 30 May 2002 10:35
32 lines
2197 bytes
Antonio <avazquez@winsoftsystems.com> wrote:
> 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?

Well, I'm guessing Java defaults to using US-standard paper sizes, and A4 is
a non-US standard size.  Have you told the print "stuff" to change the paper
size before sending your image?

-- 
Joi Ellis (TeamB)               http://www.teamb.com/
No direct email, please.
For best results, post on news server newsgroups.borland.com!
Newsgroup Guidelines: http://www.borland.com/newsgroups/guide.html
Only posts which violate the rules in guide.html are subject to cancelation.
Technical Details
Message-ID: <3cf6008d_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!supernews.com!telocity-west!TELOCITY!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.stealth.net!news.stealth.net!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!dnews!not-for-mail
References: <3cf5faa6_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,aff152e741f2b0ed
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2002-05-30 03:39:18 PST
Sender: Joi Ellis <joi@h-66-134-231-90.CHCGILGM.covad.net>
Message-ID: <3cf6008d_1@dnews>
From: "Joi Ellis [TeamB]" <joi@aravox.com>
Subject: Re: How to set printable area and reduce the margin area
Newsgroups: borland.public.jbuilder.java.api
References: <3cf5faa6_2@dnews>
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.2.19-6.2.7 (i686))
NNTP-Posting-Host: 66.134.231.90
Date: 30 May 2002 03:35:58 -0700
X-Trace: dnews 1022754958 66.134.231.90 (30 May 2002 03:35:58 -0700)
Lines: 32
X-Authenticated-User: jellis
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!supernews.com!telocity-west!TELOCITY!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.stealth.net!news.stealth.net!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!dnews!not-for-mail