In order to understand why printer is showing offline
First, check or Make Sure 'Use Printer Offline' Mode Is Not Selected
Secondly Set as default printer
Check Printer Driver version
Troubleshoot Printer Spooler Settings
Check Your Wire Connection When HP Printer Goes Offline
These are some step which can help you to fix this issue. Here if you are unable to solve this issue then do-follow link and learn step by step instruction also connects through live chat support or manual support here.