We have the following process:
1. Load a Word doc with a text and image in the page footer into Aspose.Words document
2. Do some manipulations with Aspose.Words
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, and Aspose.Pdf 3.6.
Now we upgraded to Aspose.Words 7, and Aspose.Pdf 4.1, and the same all-in-memory way (including a word doc footer image) 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, if the way I described above (everything,including images, is in memory, nothing is saved to disk as an intemediate step) is availble for the latest Aspose.Words/Pdf versions?
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);