On Tuesday May 1 2007 6:56 am, Moon, John wrote:
> Below is code I presently use to download to clients and the generated
> html. One client objects to the generated html - the
> "Content-Disposition" ... Does any one have another method to download
> AND display the pdf with perl.
>
>
> sub Display_PDF {
> my ($pdf, $pdf_size) = @[EMAIL PROTECTED]
> $|=0;
> print $q->header(-type=>'application/pdf',
> -attachment=>'Requested_Re****t.pdf',
> -Content_length=>$pdf_size,
> -expires=>'+1d',
> -status=>'200 OK');
> open RE****T, $pdf;
> while (read RE****T, my $buff, 5000) {
> print $buff
> }
> }
>
> Generates:
>
> Status: 200 OK
> Expires: Wed, 02 May 2007 14:53:53 GMT
> Date: Tue, 01 May 2007 14:53:53 GMT
> Content-Disposition: attachment; filename="Requested_Re****t.pdf"
> content-length: 92455
> Content-Type: application/pdf
>
> John W Moon
you must be i see $-q->header() method in there.
you could try :
print "Content-Type: application/pdf\n\n";
then just dump the contents of your pdf file to STDOUT...
with out knowing the full context of your situation , that is are you
generating the pdf file dynamically with a Perl module or are you just
serving it up to a browser connection via CGI ?
that make a difference on how to format the headers and push out the
file.
Greg


|