• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Scale a page using Graphics

 
Manjula Rao
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i scale a page before printing using Graphics and not Graphics2D?
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scale a Page? Do you mean limit the amount that will be printed?
 
Manjula Rao
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic