Solved

Printing a custom size page in Java

Posted on 2004-09-01
6
626 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

867 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now