'Aspose Package document not saving when using doc.save method
I have tried below two methods and ensured that license is updated along with the correct binary. Using .net framework 4.5.2. Below using doc.save method is not working.
Option 1: doc.Save(LetterTemplateEntity.CRSC_LETTER_TEMPLATE_DESC + doctype,SaveFormat.FormatDocument, SaveType.OpenInWord, this.Response);
Option 2: doc.Save(this.Response, "LetterTemplateEntity.CRSC_LETTER_TEMPLATE_DESC + doctype", ContentDisposition.Inline, null);
Solution 1:[1]
Check these articles, they might help you :
Solution 2:[2]
Acccording to the documentation, there are several overloads of the method Document.Save()
that you can use :
However make sure that you are not locking the file you read (after opening the file and executing your program at the same time).
You must use one stream (MemoryStream
) for reading and another one for writing.
Also make sure Visual Studio (run as admin) have access to the location where you try to write the file at, in case you run the program from Visual Studio.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Rivo R. |
Solution 2 |