The error appears when Windows 10 sees that the printer is unavailable.
Unfortunately, most of the time, it can’t tell if the printer is really offline or if it has connectivity problems or printing errors. They might occur when:

The connection between the computer and the printer is slow/unresponsive
The printer has encountered an internal error
There are multiple unfinished print jobs in the queue

Remove and reinstall your printer

Another way you can fix an offline printer is to remove the printer from your PC or laptop and reinstall it. To remove your printer, simply open the ‘devices and printers’ in your computer’s control panel. Right-click the model you’d like to remove and select ‘remove’

 

The first port of call is to double-check your printer’s connection with your computer. You should look at the network cable connecting your printer to your router, and check the USB cable connecting your printer to your PC or laptop. If all of these connections look to be working, try moving your cables to alternative ports.

Remove and reinstall your printer

If the above solution has not worked, try removing the printer from the system and adding it again. It is a rather simple process. However, you may also be required to download some drivers and OEMs applications. Here’s how to proceed:

 

Source: Printer offline