Exception with PDFDraw Export (Error is only present in Production Environment)

I'm having a problem with the PDFNet Library. I have this process in our application to append and remove pages from PDF files. The Code Works Fine in all the other Environments but in production we get this Exception.

Thanks for the Help.

Sample Code Start:

try {
byte[] documentBytes = ReadBytes(sDocumentPath);
using (pdftron.PDF.PDFDraw draw = new pdftron.PDF.PDFDraw())
  pdftron.SDF.ObjSet hint_set = new pdftron.SDF.ObjSet();
  using (doc = new pdftron.PDF.PDFDoc(documentBytes, documentBytes.Length))
    pdftron.SDF.Obj encoder_param = hint_set.CreateDict();
    encoder_param.PutNumber("Quality", 52);
    //Loop For pages
    pdftron.PDF.PageIterator pageItr = dReaderDoc.GetPageIterator(startPage)
    draw.Export(pageItr.Current(), "FilePath", "JPEG", encoder_param);
} catch(Exception ex) {
//Something Here...
Sample Code End:

Exception Error Message:Unable to open the file Conditional expression: m_stream != NULL Filename : StdFile.cpp Function : trn::Filters::StdFile::InitW Linenumber : 195

Target: Void Export(pdftron.PDF.Page, System.String, System.String, pdftron.SDF.Obj)

Source: PDFNet

Stack Trace: at pdftron.PDF.PDFDraw.Export(Page page, String filename, String format, Obj encoder_hints) at PDFModifyPagesPDF.RenderDocumentPages(Int32 iStartPage, Int32 iMaxPagesAllow, String sDocumentPath)

The error says that the file (the second arg to draw.Export()) can't
be created, which makes sense.

You are passing in "FilePath", but you should probably use variable
FilePath? or a correct path (e.g. @"c:/my.jpg")

This file is created from the Web Server to a NAS.

The FilePath looks like this @"\\ServerName\ShareDirectory\FileName.jpg".

The problem is that the all PDFNet methods dealing file-paths work
pnly with a local file system.

If you want to save to NAS you would need to save file localy then
move it to a shared network folder. Altenratively you could try saving
via GDI+ Bitmap:

  System.Drawing.Bitmap bmp = pdfdraw.GetBitmap();

Yes, your suggestion works.

I did not know about the file-path restrictions in PDFNet.

Thank you.