Your Operating system may recognize your printer offline as your printer is unable to connect with your Windows. For this problem there can be many causes. It is important that you actually pin point the root of this issue.
Visit here: https://5e4296106616a.site123.me/blog/how-to-change-an-hp-printer-from-offline-to-online