Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-12-29 20:38:06

treaves
New Member
Registered: 2009-12-29
Posts: 1

IE only downloads first page of PDF

Hello all. I’m using tcpdf to generate PDF’s on my site. This works well for Firefox & Safari. But for some reason, IE (tested 6 & 7) only get the cover page of the PDF. In some cases these PDFs are a couple of hundred pages.

The PDF is generated and saved to disk. When it is sent to the browser, I do this:

header(‘Content-Type: application/pdf’);
if (ob_get_contents() || headers_sent()) { $this->Error(‘Some data has already been output to browser, can\‘t send PDF file’);
}
header(‘Cache-Control: public, must-revalidate, max-age=0’); // HTTP/1.1
header(‘Pragma: public’);
header(‘Expires: Sat, 26 Jul 1997 05:00:00 GMT’); // Date in the past
header(‘Last-Modified: ‘.gmdate(‘D, d M Y H:i:s’).’ GMT’);
header(‘Content-Length: ‘.filesize($pdf_file));
header(‘Content-Disposition: attachment; filename=“document.pdf”;’);
readfile($pdf_file);

I check the PDF on disk, and it has all of the pages. This is really driving me nuts!

Is there any reason IE would be doing this? Any ideas on how to correct it? Thanks!

Last edited by treaves (2009-12-29 20:44:32)

Offline

Board footer

Powered by FluxBB