in reply to Content headers for PDF?

What type of server is it?

-Lee

"To be civilized is to deny one's nature."

Replies are listed 'Best First'.
Re: Re: Content headers for PDF?
by ryddler (Monk) on Jun 09, 2001 at 03:20 UTC
    Oops! I mentioned that it was IIS in CB. Guess you weren't there, huh? ;)

    ryddler
      I'm using Linux/Apache but I think I know what your problem is. I think it has to do with additional headers being added. I believe IIS determines automatically whether or not to add headers. Removing all the additional headers besides type and putting CGI.pm in nph mode fixed it for me. Opens in one window on IE 5.0 on a win32 machine.

      #!/usr/bin/perl use CGI qw(:all -nph ); $|++; my ($offset,$bytes,$buffer,$contents); open(PDF, "</tmp/pdftest.pdf") || die ("Couldn't open file $pr +int_pdf");; $offset = 0; $contents = ''; binmode PDF; until(eof(PDF)) { $bytes += read(PDF,$buffer, 1048576, $offset); $offset += 1048576; $contents .= $buffer; } close PDF; print header( -type => 'applicatio +n/pdf' ); print $contents;


      -Lee

      "To be civilized is to deny one's nature."