Re: compressing pdf response

2005-09-20 Thread Sonja Löhr

Thanks to you all!

If the improvement is so small I will unplug the filter. Although the
browsers do support compression (the filter is checking this), the
outcome seems to be somewhat unpredictable, and I don't know anything
about the client side in production, of course. 

sonja


Am Montag, den 19.09.2005, 21:48 +0200 schrieb J.Pietschmann:
 Sonja Löhr wrote:
  With IE (that is, acrobat inside) I get sometimes the pdf and sometimes a
  blank page, after reloading the message about a damaged file. Firefox
  (always) complains that the file doesn't begin with %PDF- (ok, indeed both
  speak German ;-)
 
 The browser explicitly asks if it will accept a compressed
 response. The server is *not* allowed to use compression (at the
 HTTP level) if the browser doesn't ask for it. Check your browser
 configuration. In Firefox, you might try the HTTP live headers
 extension for sniffing the actual values.
 
 Also, most of the PDF parts are already compressed (and re-encoded
 as ASCII85). A secondary compression will probably gain something
 between 15% and 20% for typical PDF files. Significant improvements
 are only to be expected in case of large embedded BMP images and in
 some cases if there are large embedded fonts.
 
 J.Pietschmann
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-- 
Sonja Löhr [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



compressing pdf response

2005-09-19 Thread Sonja Löhr

Hi!

This is not a FOP question, but you I'm sure you are familiar with these
things
I use FOP in a servlet and would like to add a CompressionFilter since the
output pdf is very large. 
I tried to get the output with firefox and IE the Browsers cannot handle the
output. (IE sometimes (?) can, firefox never.

The actual compression is that one:

gzipstream = new GZIPOutputStream(output);
flushToGZip();
response.addHeader(Content-Encoding, gzip);
response.setContentType(application/pdf);

I added the last line since I hoped it could help (additionally), but it
doesn't. Is there something else I could try to configure on any of the
Streams concerned? 

Before compressing, both browsers pass a test whether compressed data are
accepted.

Thanks for you help again!

sonja





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: compressing pdf response

2005-09-19 Thread Sonja Löhr


Hi, Carol!

Thank you. This is exactly the code I use :-)

With IE (that is, acrobat inside) I get sometimes the pdf and sometimes a
blank page, after reloading the message about a damaged file. Firefox
(always) complains that the file doesn't begin with %PDF- (ok, indeed both
speak German ;-)




 

 -Original Message-
 From: cgray [mailto:[EMAIL PROTECTED] 
 Sent: Montag, 19. September 2005 18:58
 To: fop-users@xmlgraphics.apache.org
 Subject: Re: compressing pdf response
 
 Hi Sonja,
 The article below, by Jason Hunter, discusses creating a 
 filter to handle compression. It also has links to samples to 
 download.
 I haven't used this, but it looks like it might be of help.
 
 Carol
 
 
 http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters-p3.html
 
 Sonja Löhr wrote:
 
 Hi!
 
 This is not a FOP question, but you I'm sure you are familiar with 
 these things I use FOP in a servlet and would like to add a 
 CompressionFilter since the output pdf is very large.
 I tried to get the output with firefox and IE the Browsers cannot 
 handle the output. (IE sometimes (?) can, firefox never.
 
 The actual compression is that one:
 
 gzipstream = new GZIPOutputStream(output);
 flushToGZip();
 response.addHeader(Content-Encoding, gzip); 
 response.setContentType(application/pdf);
 
 I added the last line since I hoped it could help 
 (additionally), but 
 it doesn't. Is there something else I could try to configure 
 on any of 
 the Streams concerned?
 
 Before compressing, both browsers pass a test whether 
 compressed data 
 are accepted.
 
 Thanks for you help again!
 
 sonja
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: 
 [EMAIL PROTECTED]
 
   
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: compressing pdf response

2005-09-19 Thread Zaleski, Matthew \(M.E.\)
I never looked closely at the PDF spec but doesn't the spec allow for internal 
compression of PDFs?  It sounds like you are filtering in compression after the 
PDF is generated and that is causing you problems with the browsers.

Matthew Zaleski 

-Original Message-
From: Sonja Löhr [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 19, 2005 1:06 PM
To: fop-users@xmlgraphics.apache.org; [EMAIL PROTECTED]
Subject: RE: compressing pdf response



Hi, Carol!

Thank you. This is exactly the code I use :-)

With IE (that is, acrobat inside) I get sometimes the pdf and sometimes a blank 
page, after reloading the message about a damaged file. Firefox
(always) complains that the file doesn't begin with %PDF- (ok, indeed both 
speak German ;-)




 

 -Original Message-
 From: cgray [mailto:[EMAIL PROTECTED]
 Sent: Montag, 19. September 2005 18:58
 To: fop-users@xmlgraphics.apache.org
 Subject: Re: compressing pdf response
 
 Hi Sonja,
 The article below, by Jason Hunter, discusses creating a filter to 
 handle compression. It also has links to samples to download.
 I haven't used this, but it looks like it might be of help.
 
 Carol
 
 
 http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters-p3.html
 
 Sonja Löhr wrote:
 
 Hi!
 
 This is not a FOP question, but you I'm sure you are familiar with 
 these things I use FOP in a servlet and would like to add a 
 CompressionFilter since the output pdf is very large.
 I tried to get the output with firefox and IE the Browsers cannot 
 handle the output. (IE sometimes (?) can, firefox never.
 
 The actual compression is that one:
 
 gzipstream = new GZIPOutputStream(output);
 flushToGZip();
 response.addHeader(Content-Encoding, gzip); 
 response.setContentType(application/pdf);
 
 I added the last line since I hoped it could help
 (additionally), but
 it doesn't. Is there something else I could try to configure
 on any of
 the Streams concerned?
 
 Before compressing, both browsers pass a test whether
 compressed data
 are accepted.
 
 Thanks for you help again!
 
 sonja
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: 
 [EMAIL PROTECTED]
 
   
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: compressing pdf response

2005-09-19 Thread J.Pietschmann

Sonja Löhr wrote:

With IE (that is, acrobat inside) I get sometimes the pdf and sometimes a
blank page, after reloading the message about a damaged file. Firefox
(always) complains that the file doesn't begin with %PDF- (ok, indeed both
speak German ;-)


The browser explicitly asks if it will accept a compressed
response. The server is *not* allowed to use compression (at the
HTTP level) if the browser doesn't ask for it. Check your browser
configuration. In Firefox, you might try the HTTP live headers
extension for sniffing the actual values.

Also, most of the PDF parts are already compressed (and re-encoded
as ASCII85). A secondary compression will probably gain something
between 15% and 20% for typical PDF files. Significant improvements
are only to be expected in case of large embedded BMP images and in
some cases if there are large embedded fonts.

J.Pietschmann



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: compressing pdf response

2005-09-19 Thread JBryant
J.Pietschmann wrote:

Also, most of the PDF parts are already compressed (and re-encoded
as ASCII85). A secondary compression will probably gain something
between 15% and 20% for typical PDF files. Significant improvements
are only to be expected in case of large embedded BMP images and in
some cases if there are large embedded fonts.



I use FOP to prepare some documents that contain no images and use only 
the standard fonts. The other day, I thought I'd zip one of those files 
before sending it to a customer, and I got a 4% gain. I sent the unzipped 
PDF file rather than make the customer unzip the file.

YMMV

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]