Display results without saving to server

Hello,
I am evaluating Aspose.Words. I have downloaded the DocumentComparision solution.

I glad to see that I can compare word documents using URLs. However, I see that the results are saved as a “temporary” file.

How can the results file be viewed WITHOUT saving the file to the server? I want to display the output on my page WITHOUT saving the file.

Please assist.

Thank you

Hello,
I am evaluating Aspose.Words. I have downloaded the DocumentComparision solution.

I glad to see that I can compare word documents using URLs. However, I see that the results are saved as a “temporary” file.

How can the results file be viewed WITHOUT saving the file to the server?

Thank you

Hi Sanaz,

Thanks for your inquiry. Please read overloaded Document.Save methods. You can save the document to memory stream and use it according to your requirements.

You may also save the document to fixed page file format and display the output in browser without saving output document to disk. Please check following code example. Hope this helps you. We will update the code of DocumentComparision application at Github.

Document doc = new Document(MyDir + "in.docx");
HtmlFixedSaveOptions options = new HtmlFixedSaveOptions();
options.ExportEmbeddedImages = true;
options.ExportEmbeddedCss = true;
options.ExportEmbeddedFonts = true;
options.ExportEmbeddedSvg = true;
// Send the document in HtmlFixed format and open inside the current browser.
doc.Save(Response, "output.html", ContentDisposition.Inline, options);

Hello,
Thanks so much.
I am now able to compare 2 word documents using URLs and output the comparison PDF from memory stream.

I’d like to display the output stream into an iframe (or embedded - whatever will work).

How can I send the response to an iframe?

Thank you!

Hi Sanaz,

Thanks for your inquiry. Please create an iframe as shown below.

In output.aspx.cs, write Aspose.Words code and save the document as shown below. Hope this helps you.

//Your code…
MemoryStream stream = new MemoryStream();
PdfSaveOptions options = new PdfSaveOptions();
doc.Save(Response, "output.pdf", ContentDisposition.Inline, options);