in reply to Outputting PDF via CGI

perldoc CGI says...

print $q->header(-type=>'image/gif',-expires=>'+3d');

So... try:

print header(-type=>'application/pdf'),$buffer;

If you're on a Winbloze box you might need to binmode the PDF file.