Skip to main content

[JAVA2D] Print Spool Issue

8 replies [Last post]
Anonymous

Hi Everyone,

I've created what I thought was going to be a relatively easy application
to send 5 page print jobs to printers throughout our company. I am getting
extremely large spool files and it is causing serious performance
problems. Using a Windows 2000 server, printers are HP LaserJet 4100 and
4200 using PCL 6 drivers. Spool sizes on the 4100 are ~4MB and on the 4200
they are in excess of 12MB.

The pages contain mostly text, a small (3k) gif on one page, and some
various rectangles drawn on 3 of the 5 pages. Fonts are all Arial with
sizes from 7-12. It is a black and white document containing no alpha that
I know of. I've tried writing the job to an offscreen image as specified
here:
http://java.sun.com/products/java-media/2D/forDevelopers/java2dfaq.html#...
but the quality was very bad and the spool size was larger.

Any ideas?

Thanks in advance,
Justin

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mars

Greetings Justin,
not sure about 'doze, in lunix land, lowering print resolution from 720x720 (normal) to 320x320 (draft) quality would reduce spool sizes by a factor of 2!
CUPS is very very good for jdk1.5.0

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

JDW Consulting

Hi Everyone:
Just wanted to give a follow-up to my print issues. I had to rush a bit to
get the app tested and into production using 5.0.

Thanks to Phil, I found that TextLayout had a bug (4480930) and was the
primary reason for the large spool files. The bug was fixed in 1.5 and
reduced my spool files to the following:
Printer Original Spool Final Spool
HP LJ 4100 4MB ~840K
HP LJ 4200 12MB ~440K

The suggestions that Karen made about disabling advanced printing helped
greatly on JDK 1.4 shrinking both spools by 50% (~2MB and ~6MB respectively)
but had no effect when using JDK 5.

The 4100 spool is still a bit large, but the users are happy for now since
it takes about 1/3 of the time in most cases. I also found that, for
whatevever reason, the PCL 6 dirvers were slower to spool (and sometimes
would fail) on the 4100. I switched to the PCL 5e drivers and spooling was
much faster and always worked.

Many thanks to Phil, Karen, and Mars for their input.

Mars,
Originally had the server set up on RedHat Enterprise. Application would not
print to a printer other than the default. I'm not a Linux guru like I would
like to be, so I suppose our sysadmin could have configured it incorrectly.
They would prefer that I use RedHat. Any thoughts?

Thanks again,
Justin

-----Original Message-----
From: Discussion list for Java 2D API
[mailto:JAVA2D-INTEREST@JAVA.SUN.COM]On Behalf Of mars
Sent: Friday, February 04, 2005 9:44 PM
To: JAVA2D-INTEREST@JAVA.SUN.COM
Subject: Re: [JAVA2D] Print Spool Issue

Greetings Justin,
not sure about 'doze, in lunix land, lowering print resolution from 720x720
(normal) to 320x320 (draft) quality would reduce spool sizes by a factor of
2!
CUPS is very very good for jdk1.5.0

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Jennifer Godinez

Hi Justin,

Just a few questions regarding your RedHat printing issue.

JDW Consulting wrote:

> Originally had the server set up on RedHat Enterprise. Application would not
> print to a printer other than the default. I'm not a Linux guru like I would
> like to be, so I suppose our sysadmin could have configured it incorrectly.
> They would prefer that I use RedHat. Any thoughts?

Can you print to a printer other than default using 'lp' command? Is
your RedHat configured with CUPS? Is the application you mentioned a
Java application?

Thanks.

Jennifer

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

JDW Consulting

Hi Jennifer,

The application is a Java application. As I recall, the sysadmin had me use
the printconf TUI to set up the printers. Not sure about CUPS and lp. I will
see if the server is still available and try it again.

Thanks,
Justin

-----Original Message-----
From: Discussion list for Java 2D API
[mailto:JAVA2D-INTEREST@JAVA.SUN.COM]On Behalf Of Jennifer Godinez
Sent: Wednesday, February 16, 2005 1:24 PM
To: JAVA2D-INTEREST@JAVA.SUN.COM
Subject: Re: [JAVA2D] Print Spool Issue

Hi Justin,

Just a few questions regarding your RedHat printing issue.

JDW Consulting wrote:

> Originally had the server set up on RedHat Enterprise. Application would
not
> print to a printer other than the default. I'm not a Linux guru like I
would
> like to be, so I suppose our sysadmin could have configured it
incorrectly.
> They would prefer that I use RedHat. Any thoughts?

Can you print to a printer other than default using 'lp' command? Is
your RedHat configured with CUPS? Is the application you mentioned a
Java application?

Thanks.

Jennifer

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Dan Blanks

Justin,

There is an lpconfig command in linux that allows you to
set the default printer. If your Java program does not
give you the option to set the printer, use lpconfig to set
the printer, then run the java program and proceed to print.

Use "man lpconfig" to see the syntax.

Dan

Quoting JDW Consulting :

> Hi Jennifer,
>
> The application is a Java application. As I recall, the sysadmin had me use
> the printconf TUI to set up the printers. Not sure about CUPS and lp. I will
> see if the server is still available and try it again.
>
> Thanks,
> Justin
>
> -----Original Message-----
> From: Discussion list for Java 2D API
> [mailto:JAVA2D-INTEREST@JAVA.SUN.COM]On Behalf Of Jennifer Godinez
> Sent: Wednesday, February 16, 2005 1:24 PM
> To: JAVA2D-INTEREST@JAVA.SUN.COM
> Subject: Re: [JAVA2D] Print Spool Issue
>
>
> Hi Justin,
>
> Just a few questions regarding your RedHat printing issue.
>
> JDW Consulting wrote:
>
> > Originally had the server set up on RedHat Enterprise. Application would
> not
> > print to a printer other than the default. I'm not a Linux guru like I
> would
> > like to be, so I suppose our sysadmin could have configured it
> incorrectly.
> > They would prefer that I use RedHat. Any thoughts?
>
> Can you print to a printer other than default using 'lp' command? Is
> your RedHat configured with CUPS? Is the application you mentioned a
> Java application?
>
> Thanks.
>
> Jennifer
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the body
> of the message "signoff JAVA2D-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the body
> of the message "signoff JAVA2D-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Phil Race

hmm .. that sounds excessive.
Particularly the 3X expansion for the 4200.
I also doubt (from your description of what you are printing)
that is anything under our control.
Unless we draw the whole page as a big raster the device resolution
shouldn't make any difference to us.
As Karen suggested its possible its something about the way you have
configured the printer driver.
Perhaps its set to always download the font rather than using
printer fonts?

The gif shouldn't do this from the size you quote and filled
rectangles shouldn't do it either.

A good experiment would be to eliminate each of these in turn to
see if it makes a massive difference.

But there are some things that can trigger text to be less efficient ..
are you using drawString or TextLayout.draw(..)?
If using the latter I'd urge you to try JDK 1.5 as that should help
a lot.

BTW I *HOPE* you are using either that or 1.4.2 already ..

-phil

Justin W wrote:
> Hi Everyone,
>
> I've created what I thought was going to be a relatively easy application
> to send 5 page print jobs to printers throughout our company. I am getting
> extremely large spool files and it is causing serious performance
> problems. Using a Windows 2000 server, printers are HP LaserJet 4100 and
> 4200 using PCL 6 drivers. Spool sizes on the 4100 are ~4MB and on the 4200
> they are in excess of 12MB.
>
> The pages contain mostly text, a small (3k) gif on one page, and some
> various rectangles drawn on 3 of the 5 pages. Fonts are all Arial with
> sizes from 7-12. It is a black and white document containing no alpha that
> I know of. I've tried writing the job to an offscreen image as specified
> here:
> http://java.sun.com/products/java-media/2D/forDevelopers/java2dfaq.html#...
> but the quality was very bad and the spool size was larger.
>
> Any ideas?
>
> Thanks in advance,
> Justin
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the body
> of the message "signoff JAVA2D-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Phil Race

posting the answer on this to the list for the record :

It turned out that Justin was using TextLayout extensively
and when he tried JDK 1.5 the spool file size came down to a
very acceptable 450K

This is because of the 1.5 fix to:
> Bug ID: 4480930
> Synopsis: Java 2D printing : TextLayout prints as filled shapes.

-phil.

Phil Race wrote:
> hmm .. that sounds excessive.
> Particularly the 3X expansion for the 4200.
> I also doubt (from your description of what you are printing)
> that is anything under our control.
> Unless we draw the whole page as a big raster the device resolution
> shouldn't make any difference to us.
> As Karen suggested its possible its something about the way you have
> configured the printer driver.
> Perhaps its set to always download the font rather than using
> printer fonts?
>
> The gif shouldn't do this from the size you quote and filled
> rectangles shouldn't do it either.
>
> A good experiment would be to eliminate each of these in turn to
> see if it makes a massive difference.
>
> But there are some things that can trigger text to be less efficient ..
> are you using drawString or TextLayout.draw(..)?
> If using the latter I'd urge you to try JDK 1.5 as that should help
> a lot.
>
> BTW I *HOPE* you are using either that or 1.4.2 already ..
>
> -phil
>
>
> Justin W wrote:
>
>> Hi Everyone,
>>
>> I've created what I thought was going to be a relatively easy application
>> to send 5 page print jobs to printers throughout our company. I am
>> getting
>> extremely large spool files and it is causing serious performance
>> problems. Using a Windows 2000 server, printers are HP LaserJet 4100 and
>> 4200 using PCL 6 drivers. Spool sizes on the 4100 are ~4MB and on the
>> 4200
>> they are in excess of 12MB.
>>
>> The pages contain mostly text, a small (3k) gif on one page, and some
>> various rectangles drawn on 3 of the 5 pages. Fonts are all Arial with
>> sizes from 7-12. It is a black and white document containing no alpha
>> that
>> I know of. I've tried writing the job to an offscreen image as specified
>> here:
>> http://java.sun.com/products/java-media/2D/forDevelopers/java2dfaq.html#...
>>
>> but the quality was very bad and the spool size was larger.
>>
>> Any ideas?
>>
>> Thanks in advance,
>> Justin
>>
>> ===========================================================================
>>
>> To unsubscribe, send email to listserv@java.sun.com and include in the
>> body
>> of the message "signoff JAVA2D-INTEREST". For general help, send
>> email to
>> listserv@java.sun.com and include in the body of the message "help".
>
>
> ===========================================================================
> To unsubscribe, send email to listserv@java.sun.com and include in the body
> of the message "signoff JAVA2D-INTEREST". For general help, send email to
> listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Karen Johnson

Hi Justin,

Try this workaround from
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4924298 :

Work-around: Printing now works for us when "Advanced
Printing Features" are disabled from the print dialog on our
PCL printer. When disabled, "metafile spooling is turned
off" and some printing options may be unavailable.

Karen

-----Original Message-----
From: Justin W [mailto:mail-lists@JDW.US]
Sent: Friday, February 04, 2005 11:48 AM
To: JAVA2D-INTEREST@JAVA.SUN.COM
Subject: [JAVA2D] Print Spool Issue

Hi Everyone,

I've created what I thought was going to be a relatively easy application to
send 5 page print jobs to printers throughout our company. I am getting
extremely large spool files and it is causing serious performance problems.
Using a Windows 2000 server, printers are HP LaserJet 4100 and 4200 using
PCL 6 drivers. Spool sizes on the 4100 are ~4MB and on the 4200 they are in
excess of 12MB.

The pages contain mostly text, a small (3k) gif on one page, and some
various rectangles drawn on 3 of the 5 pages. Fonts are all Arial with sizes
from 7-12. It is a black and white document containing no alpha that I know
of. I've tried writing the job to an offscreen image as specified
here:
http://java.sun.com/products/java-media/2D/forDevelopers/java2dfaq.html#...
l
but the quality was very bad and the spool size was larger.

Any ideas?

Thanks in advance,
Justin

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".