I did think that and we have asked the user to disable anti virus for the folder containing the file but they say they still got the error at random times. The file is on a file server so if there was a temporary network issue I assume this could cause this error?
We do actually need the resulting PDF as a file so would using a memory stream and then writing that stream to file reduce the likelihood of this error. I am a bit concerned regarding how much memory would get used if we did this and if there is more chance of running out of memory?