Hi xc123,
Welcome to the HP Forums, I hope you enjoy your experience!
I understand you can scan but aren't able to print.
I will be happy to help you.
Make sure the printer is connected directly to a wall outlet and the USB cable is connected directly to the computer.
I have provided a document for you to go through the steps starting at Solution four: Check the print driver and the port to see if we can resolve this issue.
'Printer is offline' Message Displays on the Computer and the Printer Will Not Print.
Try printing from another application.
What operating system are you using? How to Find the Windows Edition and Version on Your Computer.
Please let me know the results if you need further assistance.
Thank you for posting on the HPForums.
Have a great weekend!