Solved

Printing a custom size page in Java

Posted on 2004-09-01
6
630 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 250 total points
ID: 11960941
0
 
LVL 92

Assisted Solution

by:objects
objects earned 250 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
going to wrong jsp page 2 46
passing enum to a method 4 34
American Express @Work site and Java 4 63
Find out all repos that a user is most active on Github 1 28
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

761 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