It looks like a permission problem. The piece of software which tries to save the data is not allowed to do so. Most probably, this has to do with tightened sandboxing in Mojave vs. High Sierra.
Now the question is - what software is actually writing that data? My guess is that it must be in the Samsung driver, because I also have a Canon scanner working 100% fine with Mojave's Image Capture, while my Samsung CLX 3305 does not.
Guessing further, PDF files get created (but with garbage data inside) probably because PDF is a wrapper around the image itself, so the access problem happens somewhere hidden in the PDF creation process, whereas for more direct (JPG, PNG) formats, the error bubbles up to the surface.
So while tightened security enforced by Apple in Mojave is the change that makes the driver fail now, I'm quite sure the actual bug that needs to be fixed is in Samsung/HP's code.