Java 5.0 PostScript Printing Regression?

I have noticed after upgrading to Java 5.0 (Update 11) that when printing to a post script printer the generated post script file is orders of magnatude greater than when printing to Java 1.4.2.

For example printing a single page in Java 5.0 generates a 1MB post script file where as using the exact same code, just using Java 1.4.2 the printed file is around 67 KB.

Has anyone else noticed this regression? Has this been documented or is there a work around for it?

Thanks in advance.

Scott

[522 byte] By [ScottGillettea] at [2007-11-26 16:37:00]
# 1

There were a couple of problems that were fixed in 5.0 updates but since

you have u11 I think you should have all of those

Is the app by any chance printing Swing text components?

Take a look at bug 6452415 on bugs.sun.com

I'd like you to try JDK 7 to see if its fixed there.

One way or another you'll learn something by this since there

are no open issues that I can think of.

Go to http://download.java.net/jdk7/archive/

and download b03 or later.

If that works then try b02 to be sure its that specific fix (and

not some other earlier fix).

Conversely if it makes no difference then its much

more certain this is a new problem that needs investigation.

-Phil.

philra at 2007-7-8 23:01:58 > top of Java-index,Security,Cryptography...
# 2
Thanks for the response.After reading the bug you described I noticed that both the current 5.0 and 6.0 JDK's don't destribute the font.properties files as was done in 1.4 and prior.I am downloading JDK 7.0 now and should have more information soon.
ScottGillettea at 2007-7-8 23:01:58 > top of Java-index,Security,Cryptography...
# 3
Well the JDK 7.0 produced a smaller PostSCript file that 5.0 and 6.0 but the script seems to have an infinite loop. The job was sent to the printer but the printiner is just hung with a status of "Printing Document". It has been in that status for over 15 minutes.:(
ScottGillettea at 2007-7-8 23:01:58 > top of Java-index,Security,Cryptography...
# 4
Well the next three attempts to print using Java 7.0 were successful. All print jobs were about 260KB and took approximately 25 seconds. This is a big improvement over Java 5.0 (Update 11) and Java 6.0.
ScottGillettea at 2007-7-8 23:01:58 > top of Java-index,Security,Cryptography...
# 5
That was it Phil, wonder diagnosis. The current version of Java 7.0 corrected the issue and regressing back to b02 displayed the error.Any idea if this issue will be integrated back into the Java 5.0 or Java 6.0 lines?Thanks for all your help Phil.-Scott
ScottGillettea at 2007-7-8 23:01:58 > top of Java-index,Security,Cryptography...
# 6

Hi,

Glad to hear that this looks to be the issue.

Its possible in part that the reason the job didn't reduce completely down to

the original 1.4.2 size is that part of it is that Swing in some cases

detects printing and uses APIs that allow it to position glyphs so the string

measures more compatibly with the screen. This spool file overhead of specifying

the positions is necessary.

Or it may be that using the desktop font (eg Tahoma) adds a font download

into the Postscript job whereas before the printer didn't need to do that

as it may have been using a font that was in the printer's ROM.

Was the 1.7 b02 spool file size about the same as the one you are seeing

on 5u11? That will give an indication as to whether you'll get the full benefit

there (in a 1.5 backport).

I do think this was something that is worth backporting but haven't

yet done so. The 1.7 fix just went back recently and I wanted to see it it bake.

Also you commented :

> I noticed that both the current 5.0 and 6.0 JDK's don't destribute

> the font.properties files as was done in 1.4 and prior.

These do still exist. They are called fontconfig files as of 1.5

Full spec is here http://java.sun.com/j2se/1.5.0/docs/guide/intl/fontconfig.html

-phil.

philra at 2007-7-8 23:01:58 > top of Java-index,Security,Cryptography...