Page 1 of 1

Does Content-Encoding effect any PDF generation

Posted: Tue Jul 17, 2007 5:05 am
by dude81
Hi all,

I'm facing this problem, I'm trying to download PDF generated dynamically from the server.

When I say

Code: Select all

header('Content-type: application/pdf');
 header('Content-Disposition: attachment; filename="abcd.pdf"');
 echo $pdf->render();
All it does is it generates the pdf content but it doesnt go to the client (browser) as a save/Open abcd.pdf
When I see the headers I see the gzip compression happening . Will this effect the pdf generation??

Code: Select all

HTTP/1.x 200 OK
Date: Tue, 17 Jul 2007 09:58:25 GMT
Server: Apache/2.2.4 (Win32) DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8e mod_autoindex_color PHP/5.2.2
X-Powered-By: PHP/5.2.2
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
content-disposition: attachment; filename="abcd.pdf"
Content-Encoding: gzip
Content-Transfer-Encoding: binary
Vary: Accept-Encoding
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/pdf
Can somebody help in what I've to do. I'm using Zend Framework PDF

Re: Does Content-Encoding effect any PDF generation

Posted: Tue Jul 17, 2007 8:15 am
by volka
dude81 wrote:All it does is it generates the pdf content but it doesnt go to the client (browser) as a save/Open abcd.pdf
Then where does it go and how do you know?
When I see the headers I see the gzip compression happening . Will this effect the pdf generation??
No, the http response is always encoded in some way. This time it is gzip compressed. Doesn't matter.

Posted: Tue Jul 17, 2007 9:26 pm
by dude81
It saves on server(this is beacase I use on save function to do that). I also use an Ajax Framework, may be this is not allowing it to generate