Article View: borland.public.jbuilder.java.language
Article #17358Re: Remembering PrintJob properties
From: John P. McGrath
Date: Sat, 14 Nov 1998 00:00
Date: Sat, 14 Nov 1998 00:00
39 lines
2166 bytes
2166 bytes
Ross M. Dukeshier <dukeman@flash.net> wrote: > I'm trying to set up a program that will store a user's default printer > properties including which printer to print to (printers are networked). > > I get the impression from the JDK documentation and the Java in a > Nutshell books that the Properties object you pass to the getPrintJob > method (of the Toolkit class) is supposed to be "persistent". Unless > I'm missing something, Java passes parameters by value so I won't get > the Properties object back and I haven't found a method that will get me > the properties from the PrintJob object. The only persistency I see is > while the program is running and after the user has selected the printer > information once during that session. > > The questions: > > Is there any way to find out the properties selected for a PrintJob > object? Do PrintJob's have a standard set of properties? > > If not, is there any way other than serializing the PrintJob object to > maintain that information beyond the current program execution? I hate to burst your bubble, but you are not going to be able to do any of this with the Java PrintJob class. For starters, on Windows, PrintJob completely ignores the "properties". They just plain do not work. Also, PrintJob does not even provide basic information, such as what portion of the printed page you can print on. With JDK 1.1.7, it has just gotten to the point where you can create printed output without the blowing off the JVM (1.1.6 _will_ blow it away). There may be some relief with JDK 1.2, but I have heard it is still pretty pitiful. -- Regards, John P. McGrath <mcgrath@enter.net> <jpm@nscs.fast.net>
Technical Details
Message-ID:
<MPG.10b71d424d901fe8989711@forums.inprise.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<364D0510.5229@flash.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,41afd4a2b38a2664 X-Google-Attributes: gidf74b3,public From: mcgrath@enter.net (John P. McGrath) Subject: Re: Remembering PrintJob properties Date: 1998/11/14 Message-ID: <MPG.10b71d424d901fe8989711@forums.inprise.com> X-Deja-AN: 411740526 References: <364D0510.5229@flash.net> Organization: Software Consulting Services Newsgroups: borland.public.jbuilder.java.language