Aspose.Words support suggested I need to contact a Pdf group with the issue described below.
We have a process in place, which does the following:
1. Load a Word doc with a text and image in the page footer into Aspose.Words document
2. Do some in-memory manipulations with Aspose.Words without saning to disk
3. Save Aspose.Words doc to Aspose.Pdf.Pdf (in memory, without saving image or doc to disk)
4. Do something with pdf (also in memory, without saving anything to file system)
5. Display the resulting pdf in browser.
This way worked with Aspose.Words 5.1 + Aspose.Pdf 3.6.
Now we upgraded to Aspose.Words 7, and Aspose.Pdf 4.1, and the same all-in-memory way doesn't seem to work.
Here is a piece of code I'm using, and getting an error
"You are in direct-to-file mode,please use Close() instead of Save()."
Can you, please, let me know, how to show in browser a pdf file created in memory out of Aspose.Words doc.
Is it possible at all with the latest Aspose.Pdf?
If it is - how to change the code below to make it work?
// Doc template has text and image in the footer
Document doc = new Aspose.Words.Document("C:\\Temp\\AlertPrintTemplate.doc");
// .... Do something with Aspose.Words doc
MemoryStream stream = new MemoryStream();
int pagecount = doc.PageCount;
doc.SaveToPdf(0, pagecount, stream, null);
pdf = new Aspose.Pdf.Pdf(stream);
// ... Do something more with pdf
// show pdf in browser
pdf.Save("Alert.pdf", Aspose.Pdf.SaveType.OpenInBrowser, Response);