Article View: borland.public.jbuilder.java.language
Article #17091Re: Anyone out there willing to help?
From: Chris Hill
Date: Sun, 20 Dec 1998 00:00
Date: Sun, 20 Dec 1998 00:00
77 lines
4355 bytes
4355 bytes
On Sun, 20 Dec 1998 11:36:09 -0600, "Ross Dukeshier" <dukeman@flash.net> wrote: >Before I start, just let me say thank you for responding. I was beginning >to wonder if I'd somehow pissed everyone off out there 'cause I know there >are other people dealing with this same situation. I have tried the new PrinterJob printing method that was introduced in JDK 1.2. The interface to the printer is much improved over the JDK 1.1 PrintJob approach, but I'm still not convinced that the implementation is good enough. At least printing is possible without a dialog. Perhaps I am not using the system properly, but there isn't much overview documentation. I'm not sure how the coordinate system for the printer is defined in relation to the "imageable size" and "imageable offset". I have been unsuccessful when trying to print a rectangle at the boundaries of the imagable area on my printer (and a diagonal line from the upper left to the lower right). Does anybody know how the printer coordinate system works in 1.2? I am getting strange results, the clipping seems wrong. setJobName does not seem to change the title that appears in the NT 4.0 print job monitor. "Java Printing" is used instead (even though getJobName returns the correct result). How did this slip though QA? Was it ever tested? This comment applies to the entire printing system as well.. :) I wish there were enumeration functions to choose an appropriate Paper size. It seems like the only way to configure the printer without just guessing and validating is for the user to use the page setup dialog. The default margins seem to be 1 inch (Top, Bottom, Left, Right). >Unfortunately, it doesn't help me. I'm trying to use the new JDK 1.2 print >stuff which, I think, now doesn't need the PrintJob class. The PrintJob >class has problems on Windows in that Windows (not a Java problem) won't >return the properties and won't accept the properties that you set in the >getPrintJob method. I don't understand how this is a Windows problem. The properties interface is provided by Java, not Windows. IIRC, the actual properties aren't documented (it seems as if they were left open ended because the JDK 1.1 system was poorly designed). But if the Java implementation looked at the properties and mapped them to the Windows data, it would work. >One of the requirements for the application we're >developing is to be able to set a default printer for a user and use that >when they print. It isn't anything major, but printing was a royal pain on >the system we're replacing and we'd like to make it simple, flexible, and >not have to worry about it for a long, long time. Besides, I took the >PrintJob class I wrote for JDK 1.1.6 and ran it the other day under JDK >1.2's JRE and it also had problems. For less than a page of text it never >printed at all (after 50 minutes of printer flashing "Processing Job") and >for 4 characters took 2 minutes to print out a blank page. Is there a way to choose a printer? (besides the user making a choice in the dialog) I think this is another design flaw, but... >It looks like everything in my code is doing what it's supposed to - except >actually putting anything on the printed page. I'm saying that based on the >book having a page, the print method of printable getting called, and the >half a dozen ways I've set the graphics page including basically hardcoding >its contents. There has to be something small I'm missing but I just don't >see it. Did you set the color of the Graphics object to black (or the color you want to use)? I had this problem with mt initial attempt to print in using the JDK 1.2 system. g.setColor(Color.black); Printing in Java is still a pain. Chris Hill hillca@cs.purdue.edu
Technical Details
Message-ID:
<367d5347.92639278@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<75i7jh$5gi4@forums.borland.com> <75j357$5ga10@forums.borland.com> <75jciv$6fp4@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,5cf86e902afbf4b X-Google-Attributes: gidf74b3,public From: hillca@cs.purdue.edu (Chris Hill) Subject: Re: Anyone out there willing to help? Date: 1998/12/20 Message-ID: <367d5347.92639278@forums.borland.com> X-Deja-AN: 424293527 References: <75i7jh$5gi4@forums.borland.com> <75j357$5ga10@forums.borland.com> <75jciv$6fp4@forums.borland.com> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.language