What is the current working directory of the program? Probably not where you think it is (often the "Program Files\X" directory on Windows).
Where is "user.pdf" going to be written? In the current working directory of the program.
Can it be written there? Possibly not.
Where are you looking for "user.pdf"? Possibly not in the current working directory of the program.