Hi John. My name is***** you for your question and the opportunity to assist.
Your printer software is downloadable online. Go here:
Under Option 2, click GO
click the Download button for HP Deskjet 2540 All-in-One Printer series Full Feature Software and Drivers
Select Download Only
Once the download is save on your machine, run the executable file to install the software.
Hi John. Were you able to download the software and perform the installation?