in reply to How to make work HTML::HTMLDoc on browser?

You are printing a HTTP header, but not specifying the content type, so it's defaulting to text/html. A PDF is neither text or HTML.

print $cgi->header("Content-type: application/pdf");

This is explained in the links I gave you over a week ago when you asked in the chatterbox, before you showed any code. Even if you only read the troubleshooting section Getting Your CGI Scripts Working it explains this.