Article View: borland.public.jbuilder.java.language
Article #17360Re: Remembering PrintJob properties
From: Ross M. Dukeshier
Date: Sat, 14 Nov 1998 00:00
Date: Sat, 14 Nov 1998 00:00
53 lines
3054 bytes
3054 bytes
John P. McGrath wrote: > > 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> That's not comforting by any stretch. Just for clarification, what do you mean by blowing off the JVM? What does it do? I've got a program provided in the Java in a Nutshell examples book (~p. 177) that says it prints on Windows platforms (even corrects some of the bad reporting Windows does). It has methods that appear to handle/track the margins, lines, pages, headers, etc. I haven't tried it yet, so I don't know if it's a tease. This is pretty important - could you please tell me more? Thanks for the assistance. Even if it ends up being a no-go, the information is very interesting. Ross Dukeshier
Technical Details
Message-ID:
<364DB92E.5986@flash.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<364D0510.5229@flash.net> <MPG.10b71d424d901fe8989711@forums.inprise.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,41afd4a2b38a2664 X-Google-Attributes: gidf74b3,public From: "Ross M. Dukeshier" <dukeman@flash.net> Subject: Re: Remembering PrintJob properties Date: 1998/11/14 Message-ID: <364DB92E.5986@flash.net> X-Deja-AN: 411833043 Content-Transfer-Encoding: 7bit References: <364D0510.5229@flash.net> <MPG.10b71d424d901fe8989711@forums.inprise.com> Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Reply-To: dukeman@pop.flash.net Newsgroups: borland.public.jbuilder.java.language