Hello Anastazia,
As you have mentioned that you were earlier able to print PDF files successfully, so the first point which I think is if you are printing any complex jobs now or if the error is found only with certain files or certain pages in the file.
Try to simplify the print job if it is actually too complex for the device to process. If a particular page or few pages are containing complex images or graphics then you may try to print those pages separate from the other pages. Other way to simplify job could be printing pages in small page groups (group of 5, 10, 15 pages depending on total number of pages in the job & error frequency/symptoms).
Other basic steps you may perform are:
1) Upgrading product firmware (if product is using older firmware) using following HP web link (applicable for MAC OS)
2) Upgrade printer drivers with full software solution available at following HP web link
Hope this helps!