Hi,
An HP OfficeJet Pro 8720 is listed in About AirPrint - Apple Support. This means that the model in question should be compatible with macOS 14 Sonoma without the need for an additional driver, provided that the printer and the Mac computer are connected to the same network (Wi-Fi router).
Do not use USB if you want to try AirPrint.
AirPrint works with wireless (Wi-Fi) or wired (Ethernet) network connections, so you could choose to wire this printer model to one of the LAN ports of the Wi-Fi router instead. An Ethernet connection may be more stable, and would avoid some of the difficulties related to the use of Wi-Fi.
If necessary, if there is a problem with AirPrint, try a full power-cycle sequence (including the router):
Power off the Wi-Fi router, the HP printer, the Mac, and all other devices/computers. Wait two to three minutes. Power on the router. Wait two to three minutes. Power on the HP printer. Wait a minute or two. Power on the Mac. Finally, power on all other devices/computers.
http://h10032.www1.hp.com/ctg/Manual/c05050200.pdf#xref_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)