🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #17098

Re: Anyone out there willing to help?

#17098
From: Chris Hill
Date: Mon, 21 Dec 1998 00:00
105 lines
5469 bytes
On Mon, 21 Dec 1998 06:09:31 -0600, "Ross Dukeshier"
<dukeman@flash.net> wrote:

>
>>It isn't an off by X problem.  It seems to me that the clipping and/or
>>coordinate system is inconsistent with the values returned for the
>>imageable properties.  The left and right on my printer have a 0.25"
>>non-printable margin.  I have not been able to get output closer than
>>0.5" from the left.  I can get output 0.25" from the right side of the
>>page.
>>
>
>
>It was just a guess - There may be a mapping problem then.  Did you try the
>validatePage method?  If you're pulling defaultPage it doesn't adjust for
>your printer.  I think validatePage gets the right information from your
>printer...

Yes, I called validatePage before I called setPrintable with the
validated PageFormat.

>>Where is the origin in the coordinate system?  At imageableX and y?
>
>
>I think so.  That's the implication.

The problem for me is that if I draw a line from (0,144) to (5000,
144), the left 0.25" is missing (the left margin in 0.5" instead of
0.25"). 

>I thought so too at first until I noticed the dialog that comes up is
>identical to Word's.  You're right, if you hit the print button on the
>toolbar, I don't think it brings up the dialog.  But, if you use the Print
>menu option, it does (at least mine does).  Try it and see what it looks
>like...It should look familiar...

I'm not saying that the JVM doesn't use the Windows dialog.  It
doesn't use it correctly. <g>  

>I don't know what you're referencing when you say you don't know if it's
>possible to do what I describe.  Reuse the properties again?  Java docs said
>you should be able to.  The PrintJob wasn't necessarily a single PrintJob.
>It was basically a connection/format for the printer.  It was supposed to be
>able to be reused throughout the run and, if the print dialog saved its
>state to the properties, to be set as defaults for the next session...
>My guess is the reason the printDialog (and the PrinterJob class in general)
>doesn't have a means to return its properties is because they still haven't
>gotten around the Windows bug.

My guess is that Java doesn't save the information.  I think it is a
Java bug, not a Windows bug.

>>
>>Your example did print two pages on my machine.
>
>
>Did the second page have any text on it?  Like a 51 down to 60????  If so, I
>wonder what's different between our two machines???

Yes it did 51..60.  My machine is NT 4.0 SP3.  My printer is an HP
DeskJet 660C (HP driver version 11.0).

>Guess I should use my own advice, eh?  You are correct.  I should be using
>the getImageableX method and yes, this approach does assume it's centered.
>To be honest, I just wanted something to approximate it to get it running at
>this point and I think, at the time, wasn't familiar enough with the methods
>to remember that one (although I was by the time I responded to yours).

Well, your approach happened to work on my system.  I'm still trying
to print that stupid printable area bounding box.. :)  But if you want
pagination and word wrap to work correctly, you will need to know the
bounding box as well.  

Searching the Sun bug database is painful, they need a more powerful
search engine that allows you to browse bugs by class.  Too many bugs
get returned on almost every query I make... :)  I also wish they
would catch duplicate bugs before they enter the database (or at least
prevent them from showing up in the search results one they are
classified as duplicates).  They pollute my searches... 

>>BTW does your print function get called twice for each page?  That
>>also happened in my example.
>
>Yes, it does.  In fact, I've modified it since the version you saw to make
>it simply return whether or not the page exists on the first pass and to set
>the graphics on the second pass.  It made it so I got the first page and a
>blank page like all the other things I've tried.

I don't quite understand why it needs to call the function twice, but
I figure that I'd better draw both times.  It doesn't do it to count
pages, because I tried setPageable instead of setPrintable and it
still calls print twice for each page (Pageable can return the number
of pages).

I am always impressed with the lack of quality in the Java classes, it
takes a complete lack of testing to make them so poor.  The problems
we are having with the printing classes lead me to believe that the
printing classes were never tested internally, the test cases were
completely inadequate, or the results were ignored.  JDK 1.2 (Java 2,
or whatever you call something that is not a rose) was supposed to be
a well tested release... I read all about it at java.sun.com <g>


Chris Hill
hillca@cs.purdue.edu
Technical Details
Message-ID: <367e81f5.170125217@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <75i7jh$5gi4@forums.borland.com> <75j357$5ga10@forums.borland.com> <75jciv$6fp4@forums.borland.com> <367d5347.92639278@forums.borland.com> <75kbl4$7921@forums.borland.com> <367df9a6.135230401@forums.borland.com> <75le46$7ov4@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/21
Message-ID: <367e81f5.170125217@forums.borland.com>
X-Deja-AN: 424559324
References: <75i7jh$5gi4@forums.borland.com> <75j357$5ga10@forums.borland.com> <75jciv$6fp4@forums.borland.com> <367d5347.92639278@forums.borland.com> <75kbl4$7921@forums.borland.com> <367df9a6.135230401@forums.borland.com> <75le46$7ov4@forums.borland.com>
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.language