I’m experiencing an issue using the Document.Save method. My goal is to retrieve documents through a service created using IIS. If the document is a .doc type, it should be saved as a pdfStream first. To achieve this I’m using the code seen below.
Stream sourceData = File.ReadAllBytes(filePath); MemoryStream pdfStream = new MemoryStream(); wordDocument = new Aspose.Words.Document(sourceData); wordDocument.Save(pdfStream, Aspose.Words.SaveFormat.Pdf); pdfStream.Position = 0; return( pdfStream );
Strangely, this works when I set up the service locally on my computer and debug through it but doesn’t when I’m attempting to retrieve the same document on the UAT machine. The code falls over at wordDocument.Save(pdfStream, Aspose.Words.SaveFormat.Pdf); but doesn’t provide an exception message or inner exception. I think this might be related to the apppools permissions/behaviour on the uat machine and was wondering if anyone could advise.
I’m using Aspose.Words version 8 & cannot upgrade as it would cause issues with our framework. I don’t believe the issue is version related either since it works locally.