As I Understand you need help printing using the HP 5740 printer as it keeps popping up the message - "out of paper" though there's paper already in the tray,
Don't worry as I'll be glad to help, however, to provide an accurate resolution, I need a few more details:
Have you loaded paper into both the trays? (if the photo tray is empty this could cause an issue as it detects both trays before printing, you may want to insert a paper though you don't intend to print a photo) 🙂
If you've done the above, did you clean the rollers?
While you respond to that, here's what you could do to fix this concern:
Step 1: Check the condition of the paper and reload it
The type and condition of paper can affect the way your printer picks paper. The edges of low-quality paper that has absorbed moisture might curl or lift the sheet so the paper does not feed into the printer.
Step 2: Clean the rollers
Dust, paper fiber, and other debris might accumulate on the pick rollers and cause paper feed issues. To help prevent paper feed issues, clean the rollers inside the printer and in the duplexer (if equipped).
Step 3: Reset the printer
If the other steps in this document fail to resolve the issue, then reset the printer.
Without turning the printer off, disconnect the power cord from the rear of the printer.
Wait 30 seconds, and then reconnect the power cord to the rear of the printer.
Press the power button to turn on the printer, if it did not power on automatically.