I'm using the following code to load the license file (in my global.asax file's Session_Start method) and I can step through my web application code, but still, I get garbage text in my documents. My MS Word Template documents are being retrieved from the backend mssql database. Does that affect anything? I tried breaking the code by placing an incorrect license file and it does break, so I know that my license file is being used. I wrote a page that uploads an MS Word Template document, then uses that to do merges, in that case, my final document does NOT show garbage text and works fine. I can't figure out what is different between the two processes. The two methods I use (one for loading the template doc from database, the other to load template doc from webpage) are also provided below. Any help would be appreciated.
-Munzoor.
*****
License li = new License();
String licenseFileFullPath = ConfigurationSettings.AppSettings.Get("AsposeLicenseFileFullPath");
li.SetLicense(licenseFileFullPath);
************** Loading Template Document From Database **************
public static Document getDBDocument()
{
byte[] b = // I use an OR mapping tool to get the column that has the byte[] value, the column is of type "image";
MemoryStream ms = new MemoryStream(b);
Document doc = new Document(ms);
return doc;
}
************** Loading Template Document From Webpage **************
// The uploadedFile byte[] is coming from the front end where I have a FileUpload control
// called fuBrowse and I use fuBrowse.FileBytes to get the byte[]
public static Document getDocumentFromUpload(byte[] uploadedFile)
{
MemoryStream ms = new MemoryStream(uploadedFile);
Document doc = new Document(ms);
return doc;
}