?
Solved

Printing a custom size page in Java

Posted on 2004-09-01
6
Medium Priority
?
637 Views
Last Modified: 2008-02-01
I need to print a custom size page on a tractor fed dotmatrix impact printer.  Everything I've ever seen seems to print to standard page sizes.  I want to print a batch run to a custom size - therefore the printer just advances the appropriate amoutn each time and does the next perforated page.

I can print everything fine on A4 on a different printer (so no trouble with the general printing stuff) but how do I set the custom page size?

Thanks
0
Comment
Question by:kiwi_alien
[X]
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
  • 3
6 Comments
 
LVL 92

Expert Comment

by:objects
ID: 11960939
you specify that in the PrintRequestAttributeSet
0
 
LVL 35

Accepted Solution

by:
girionis earned 1000 total points
ID: 11960941
0
 
LVL 92

Assisted Solution

by:objects
objects earned 1000 total points
ID: 11961024
try:

PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
pras.add(new MediaSize(x, y, units));
pras.add(new MediaPrintableArea(x, y, w, h, units));
0
 
LVL 92

Expert Comment

by:objects
ID: 11961105
the x,y above should should really be different vars, was just showing the classes involved.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses
Course of the Month9 days, 3 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