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:
pdftron.PDFNet.Initialize(_PDFTronLicenseKey);
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))
{
doc.InitSecurityHandler();
draw.SetDPI(95);
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...
}
pdftron.PDFNet.Terminate();
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)