The web application that delivers the PDF file to your browser can set HTTP headers for content-type and content-disposition. That's how the browser knows to treat it as a PDF file and pull up the viewer. It's also how the web application can send your browser a default filename that comes up when you do a Save As. That works better for attachment content-dispositions than for inline ones.

This explains how the file name is specified by the server, but not how to override it.
–
KaranApr 3 '13 at 16:24

True, the user has to pull up a Save As browser dialog. This just explains where the default filename in the dialog comes from. (For inline dispositions it defaults to the page name instead.)
–
criticalfixApr 3 '13 at 16:31

The built-in viewer only has a download function and does not prompt to set the filename. However, it is still possible to do it via the Firefox menu. To specify the file name, use File → Save Page As... menu option.