note 25285 modified in ref.pdf by vincent

From: Date: Tue, 02 Sep 2003 14:32:58 +0000
Subject: note 25285 modified in ref.pdf by vincent
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-55476@lists.php.net to get a copy of this message
If you use session, all headers you can send about "cache" are too late ! See http://bugs.php.net/?id=19450&edit=2 The solution is something like this : <?php // Default is "no-cache" session_cache_limiter('private'); session_start(); $pdf = pdf_new(); /* your code here */ pdf_close($pdf); $buf = pdf_get_buffer($pdf); $len = strlen($buf); header("Content-type: application/pdf"); header("Content-Length: $len"); header("Content-Disposition: inline; filename=foo.pdf"); print $buf; pdf_delete($pdf); ?> --was-- If you use session, all headers you can send about "cache" are too late ! See http://bugs.php.net/?id=19450&edit=2 The solution is something like this : <?php // Default is "no-cache" session_cache_limiter('private'); session_start(); $pdf = pdf_new(); /* your code here /* pdf_close($pdf); $buf = pdf_get_buffer($pdf); $len = strlen($buf); header("Content-type: application/pdf"); header("Content-Length: $len"); header("Content-Disposition: inline; filename=foo.pdf"); print $buf; pdf_delete($pdf); ?> http://www.php.net/manual/en/ref.pdf.php

« previous php.notes (#55476) next »