So the last part of each line disappears? In stead of 1234567890 it prints 12345 with spaces where the 67890 should be. And that's only at the end of long lines or also at the end of short lines? Or do short lines print completely?

However, there is a difference between printing spaces and a wrong margin setting. If for some reason the printer thinks the right margin is immediately after the 5 it won't print spaces in stead of 67890, but it will print nothing there. And if the printer driver thinks the margin is more to the right, you'll see them in the print preview.

You don't see any difference, but it's something different, that can have different causes. It could be a driver/setting issue, or a hardware issue.
I'd try the printer with the latest drivers from the HP site on another PC. If it's wrong there also, it's time for a new printer.