Solved

Printing a custom size page in Java

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
array6 challenfge 6 64
stringclean challenge 26 57
mapAB Challlenge 35 89
sites similar to codingbat to improve coding hanson skills 3 23
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 first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
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.

760 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

26 Experts available now in Live!

Get 1:1 Help Now