Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print problem

Status
Not open for further replies.

jack1971

Programmer
May 23, 2002
14
CA
I was trying to print one form by Java Program. I have used Graphics2D to construct one grid (22X6, say). Since the form needs 1cm margin on both left and right sides, I made the grid from point(28,230) to (584,590). The form looks fine on the screen exactly the way I want it.

Now the problem is: when I tried to print the form by calling PrinterJob.print() using PageFormat.defaultPage(), which is 8.5X11, about 1 inch wide can not be printed out on both sides so that my form is incomplete. I tried to change the printer preference to set the margin as 0, it is not work right.

Please help me out.

Thanks!
 
I haven't done anything like this, but i guess, the problem is, that your doing some margin stuff before you print it (that is inside the graphics)

As the PageFormat seems to have margins included you don't have to do that in your document, too.

Hope this helps
Christoph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top