• Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing A4 without margin  RSS feed

 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I want to print a paper with Java without the margin.

But how can I do that?

This is my code now:

 
Rob Spoor
Sheriff
Posts: 21133
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The defaultPage() PageFormat usually has a marging. You need to change it to remove that margin. I believe the following should work:
By default, Paper instance have a margin on each side that decreases the imageable area. By specifying that the imageable area should be as large as the entire Paper you will remove those margins. Don't forget to set the Paper at the end - getPaper() returns a clone of the PageFormat's Paper.
 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:The defaultPage() PageFormat usually has a marging. You need to change it to remove that margin. I believe the following should work:
By default, Paper instance have a margin on each side that decreases the imageable area. By specifying that the imageable area should be as large as the entire Paper you will remove those margins. Don't forget to set the Paper at the end - getPaper() returns a clone of the PageFormat's Paper.




Hmm.. tis is not working.. I print it and I still get the white margins..
 
Paul Clapham
Sheriff
Posts: 22819
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Printers usually can't put ink on the entire surface of the paper which passes through them. So you may already be using as much paper area as possible. Have you tried using other applications to see what happens with them when you say "Margins = 0 cm"?
 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:Printers usually can't put ink on the entire surface of the paper which passes through them. So you may already be using as much paper area as possible. Have you tried using other applications to see what happens with them when you say "Margins = 0 cm"?


Hmm.. I'm trying to print it to PDF now (so I don't wast any paper) with Bullzip PDF printer.

I will try it now with the real printer! :)
 
Gynnad Paullussen
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gynnad Paullussen wrote:
Paul Clapham wrote:Printers usually can't put ink on the entire surface of the paper which passes through them. So you may already be using as much paper area as possible. Have you tried using other applications to see what happens with them when you say "Margins = 0 cm"?


Hmm.. I'm trying to print it to PDF now (so I don't wast any paper) with Bullzip PDF printer.

I will try it now with the real printer! :)


Also that is not working.. I'm trying to print some text, but in the with he doesn't print everything.
Also both sides there is a margin. (normal margin of a A4)
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!