Print pdf button script

Can anyone tell me if this is possible please and how I’d go about doing it.

I’ve got a button which links to a pdf. Once clicked the pdf tries to download onto the users computer. What I’d like to happen instead is for the pdf to print instead of trying to download. Is there a way of doing this?

Thanks for any help in advance

That isn’t something you can control from the web page. A web page has no way to print anything other than the current page and has no way to tell what printers may be available.

There might be a javascript function for this, although it is complicated by the fact that pdf is a whole new file which needs to be opened.