aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Scale a page using Graphics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Scale a page using Graphics" Watch "Scale a page using Graphics" New topic
Author

Scale a page using Graphics

Manjula Rao
Greenhorn

Joined: Dec 13, 2000
Posts: 21
how do i scale a page before printing using Graphics and not Graphics2D?
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Scale a Page? Do you mean limit the amount that will be printed?


"JavaRanch, where the deer and the Certified play" - David O'Meara
Manjula Rao
Greenhorn

Joined: Dec 13, 2000
Posts: 21
No i do not mean limiting the area printed but to reduce the size of the fonts proportionately so that the whole web page is acomodated in one page. ofcourse by that i mean width wise well accomodated and not page wise. if the matter spans over multi pages then it will continue doing so.
this i am able to do thru Graphics2D using
Graphics2D g2d = (Graphics2D)g; //where g is a Graphics object.
g2d.translate(50,50);
g2d.scale(0.5f,0.5f);
this scales the page to 50% of the actual size proportionately.
Now the problem that i am having is that using Graphisc2D object scaling is possible but multi page printing is not getting possible. but if i use a Graphics object then multipage printing is perfect but the matter printed is huge and sometimes gets cut from the margines.
if any suggestions regarding these problems, they r welcome.
thanx
Manjula
Jahanzeb Sayal
Greenhorn

Joined: Mar 02, 2001
Posts: 21
MultiPage printing is possible using Graphics2D ...
Read the printing article on www.javaworld.com & also read chapter 6 of the following online book i belive it will work becoz i have just done it... if any problems ... tell me i will post the code... u can email me...
http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/index.html

Sayal
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scale a page using Graphics