It’s possible to fix the hp printer offline error by following simple steps. To begin, you should manually set the default printer, and now check the printer port and Windows services status, and create a manual IP connection (network connections only). Thereafter, you are supposed to connect the PC to a TCP/IP Port (Windows only, the network only) and then troubleshoot the printer connection.
https://printersofflines.com/blog-post/hp-print-and-scan-doctor/