How do I resolve 'Failed creating a temporary file'?

Q: We are rolling out PDFNet to a client and suddenly get this error
when we try to watermark a file (just before streaming it to

Message: Failed creating a temporary file Conditional expression:
   at pdftron.PDF.Stamper.StampText(PDFDoc dest_doc, String txt,

Any idea what could cause this?

A: The problem is that PDFNet.DLL does not have a permission to create
a temporary file.

There is couple of potential options:

a) Grant 'PDFNet.DLL' R/W permission to the temporary folder (btw. you
can also change the location of the TempFilder using
PDFNet.SetTempFolder()). For more info please see

b) After initializing PDFNet call