We just upgraded from 3.9 to 4.0. I was getting the "The path is not of a legal form." error when I tried to view an invoice/PDF and found this thread.
Not sure it is a permanent fix, but I did NOT have a logo image uploaded to Settings > General Settings > PDF. When I uploaded a logo, I was able to open and print the PDF invoices.
Incidentally, the first time I tried to save the setting, I got an error message, but the second time I tried the settings saved and this worked, at least for now.