Is that HP 4140 series printer AirPrint-compatible? Find out here: https://mfi.apple.com/account/airprint-search
That site is not very user-friendly but this is what I was able to determine after a cursory search:

It would appear that if your HP printer is in fact the DeskJet Plus 4140 All-in-One Printer as that search result suggests, then remove the existing entry in Printers & Scanners and add it again, as an AirPrint printer. You must explicitly choose AirPrint.
For reference:
Connect an AirPrint printer to a Wi-Fi network
Add a printer to your printer list so you can use it on Mac
Don't download or installing anything from HP. It probably won't work.