in reply to Re: Re: Content headers for PDF?
in thread Content headers for PDF?
#!/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;
|
|---|