Hi Jan,
See:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4833528
It's basically the same problem that you're running into, but
unfortunately the bug report doesn't mention the Unix-specific
workaround, which is:
-Dsun.java2d.pmoffscreen=false
(Hopefully that should work.)
Chris
On
I am trying to set a custom paper size using printer jobs but it does not take
my custom paper size and instead it takes the default paper size. The code I am
using is as follows:
PageFormat pageFormat = job.defaultPage();
Paper paper = new Paper();
paper.setSize(500,500); //
Sorry again,
the word new dropped from
PageFormat format = PageFormat();
this should read:
PageFormat format = new PageFormat();
Piet
[Message sent by forum member 'pietblok' (pietblok)]
http://forums.java.net/jive/thread.jspa?messageID=241227
Right, on windows, the default paper size is based on the default
for the printer which is what makes a lot more sense than a hard-coded
value. I believe this was fixed a LONG time ago (1.3 ie 1999-2000)
-phil.
[EMAIL PROTECTED] wrote:
I forgot to mention that, at that time, the default paper
I forgot to mention that, at that time, the default paper size was Letter,
which was fine for people living in the US, but rather annoying for people
living in Europe.
That is why I had to create my own A4 class.
Have a nice weekend.
[Message sent by forum member 'pietblok' (pietblok)]
Well, I am not an expert on printing issues, so probably it is as difficult for
me as it is for you. The code snippets came from a class that I created some
time ago and that seemed to work for me. I remember that it took me some time
to get it working at all. The original version of this code
If your printer doesn't support custom paper sizes, then
setting one will just cause the closest supported paper
size to be used.
However there is also a bug specific to the case when the
end user then changes the printer in the print dialog
to one that is not the system default one where we
Sorry the code of the Custom class is below:
private class Custom extends Paper {
public Custom() {
super();
setSize(594,491);
setImageableArea(36.0, 36.0, 522.99212598425197, 450.8897637795276);
}
}
[Message sent by forum member 'lucho01' (lucho01)]
Hi Piet thanks for your help, I am trying to resolve my problem using your code
but it did not worked. I am still getting the size A5 no matter what I try to
define. I don't know if I am missing something. Please look at the following
code and see if you can find what I cant find.
PageFormat
Hi,
I am not sure what you are doing wrong. However, a long time ago I experimented
with printing and maybe some code snippets will help you.
private class A4 extends Paper {
public A4() {
super();
setSize(594.992125984252, 841.8897637795276);
10 matches
Mail list logo