|
Quick Lists
|
|
Bug ID:
|
4100712
|
|
Votes
|
3
|
|
Synopsis
|
RFE: International Paper Sizes for PageFormat and javax.print APIs
|
|
Category
|
java:classes_2d
|
|
Reported Against
|
1.2beta2
|
|
Release Fixed
|
1.4(merlin-beta)
|
|
State
|
10-Fix Delivered,
request for enhancement
|
|
Priority:
|
4-Low
|
|
Related Bugs
|
|
|
Submit Date
|
19-DEC-1997
|
|
Description
|
In Class java.awt.print.Paper, we have a single
constructor, described as follows:
Paper()
Creates a letter sized piece of paper with one inch margins.
It seems to me that it would be better if we made
the Paper constructor more culturally neutral, for
all of our non-U.S. friends out there.
I'd like to suggest that this constructor be
changed to (not supplemented by, but changed to):
Paper(int size)
where the various built-in
constants would include the following:
Paper.USLETTER, Paper.USLEGAL, Paper.A4, Paper.A5,
and so on. That way, I would call
Paper myPaper = new Paper(Paper.USLETTER);
and someone in Japan could use the same code,
with "Paper.A4" in place of "Paper.USLETTER".
I think this approach is more appropriate in
an international language like Java.
Of course, you'll still have to decide what
margins to use, but since no two people use
the same sized margins, they probably won't
customer to having to set them after calling
the constructor. As long as the constructor
simply respects national paper size standards,
which don't usually vary from person to
person within the same locale, it should be okay.
__Glen Perkins__
xxxxx@xxxxx
(Review ID: 22200)
======================================================================
|
|
Work Around
|
On win32 in 1.3 and above, uf you get a default page : PrinterJob.getDefaultPage() from a printer,
the printer driver should have correctly informed the implementation of the
default paper size for the printer, which is typically A4 in non-US locales.
You can then do PageFormat.getPaper() and you have a localised default Paper.
Arguably this is actually better since its guranteed to be suitable for your
printer.
|
|
Evaluation
|
Default paper perhaps could be locale-specific.
It may may be that at this time the required solution is to add a second
constructor which takes a locale.
In an upcoming release we do plan to allow named paper sizes which may also
be useful in this regard.
=====================
What is most needed here is to obtain a PageFormat (which embeds a Paper)
corresponding to the default paper for the printer for which the PrinterJob
is destined.
The API for this already exists ss PrinterJob.defaultPage().
This already is implemented on win32.
On Solaris & Linux there's no easy way to obtain this, but a better
default than US/NA letter everywhere is US /NAletter just in North America.
This is implemented in merlin (1.4).
Similarly the javax.print APIs provide printer-specific defaults where
possible, falling back to locale-specific defaults wher ethe printer can't
be queried directly.
xxxxx@xxxxx 2000-11-17
========================
|
|
Comments
|
Submitted On 15-JUL-1999
p_leal
Very good Idea,
we here (Switzerland) stay in trouble, cause
nearly unpossible to create a Paper with the correct
margins. do you have a Idea why????
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|
|
|
 |