Java printing question

Posted on 2003-02-19
Medium Priority
Last Modified: 2010-03-31
Is it possible to print with printerJob on Win2K/XP with other paper size then defined in the Win-driver ?
Question by:gaboresz
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

yongsing earned 300 total points
ID: 7984850
Why don't you try it out? Create a Paper object and set the paper size you want. The width and height are specified in units of 1/72 of an inch. The following example set the paper to approximately A4 size.

PrinterJob printerJob = PrinterJob.getPrinterJob();
PageFormat pageFormat = new PageFormat();
Paper paper = new Paper();
paper.setSize(594.936, 841.536);
paper.setImageableArea(72, 36, 450, 769);
printerJob.setPrintable(this, pageFormat);

Expert Comment

ID: 9059227
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Suggested Courses
Course of the Month8 days, 12 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question