• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

javax.print

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a way in the javax.print API to specify the length of the right, left, top and bottom margins? If so what is it?
 
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rish:
Welsome to JavaRanch. As far as I can tell, setting your margins is something that you have to do in your document that you are printing -- since the document has to be abl to format itself, it needs to know the margins.
Alternatively, you might look at setting the Media Printable Area attribute. It will allow you to position the x,y position on the media where printing starts, but it only effectively sets the top and left margins; the right and bottom are still document-dependent.
[ October 21, 2003: Message edited by: Joel McNary ]
 
Rish Khopkar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah, Actually right after posting this question, I looked at the API and tried out the MediaPrintableArea and got it to work. Unfortunately, it is not a very clean way to do it, and I had to hack around and change the size of the Printable area to be much larger than that of my document, and do some other positioning magic to get it to work.
Thanks for your reply.
I see what you're saying, but it seems like it wouldn't hurt to have a clear way of saying through the API that my left margin is x inches, my right margin is y inches, my top margin is p inches and my bottom margin is q inches.
Amarish
reply
    Bookmark Topic Watch Topic
  • New Topic