Hi,
Is this an HP ENVY 4520 All-In-One Printer or HP ENVY 4520 e-All-In-One Printer series printer. If so, it is supported by the driverless AirPrint technology (About AirPrint - Apple Support), and can be used without an additional driver, provided that the printer and the MacBook Pro are connected to the same network (Wi-Fi router).
Try this: Check that the Wi-Fi router settings are OK. Next, power off the Wi-Fi router, the printer, the Mac, the iPhone, and all other connected devices/computers. Wait two to three minutes. Power on the router. Wait two to three minutes. Power on the printer. Wait a minute or two. Power on the Mac. Power on the iPhone. Finally, power on all other devices/computers.
If necessary, try resetting the printing system and re-adding the printer (to use AirPrint)?
Reset the printing system on your Mac to solve a problem – Apple Support (UK)
Add a printer to your printer list so you can use it on Mac – Apple Support (UK)