In the program you want to print from, click File, and then click Print.
Make sure your printer is in the Name or Printers drop-down list box, and then click Properties, Printer Properties or Preferences.
Click the Paper/Quality tab.
Click Advanced, if necessary, and then click Paper Size.
Select the paper size that matches the size and type of paper loaded in the printer tray, and then click OK. If there are no matching paper sizes, select the size from the list that is closest to the size of the paper loaded in the tray.
Click OK, and then try to print.
You can refer this HP document for more assistance:- Click here
I hope that helps.
To thank me for my efforts to help you, please mark my post as an accepted solution so that it benefits several others.
Be alert for scammers posting fake support phone numbers and/or email addresses on the community. If you think you have received a fake HP Support message, please report it to us by clicking on "Flag Post".