?
Solved

Printing a custom size page in Java

Posted on 2004-09-01
6
Medium Priority
?
641 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
4 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month17 days, 8 hours left to enroll

831 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