To fix the Printer offline or any other issue with your HP printer, you need to download HP Print and Scan Doctor. Download the tool and install it on your computer first and then follow the steps below:
When the HP Print and Scan Doctor opens, select Start.
Now find and select your Printer. If you don’t see your Printer listed, click on Retry to scan the list again. In case you see a connection problem, follow the on-screen instructions to resolve it.
Select Yes to turn on printer updates if the prompt shows up.
Also select Yes, if you get a prompt to set your HP Printer as default.
Check if your HP Printer offline problem is resolved or not.