We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

[SOLVED] OpenInBrowser with Aspose.Words.16.10.0?


I am attempting to open a PDF in a new Browser Window. We have recently migrated from a very old version of Aspose (Aspose.Words.2010.4.7) to new Aspose.Words.16.10.0. Previous code looked like this:

translator.AsposeWordsDocument(true, letterTemplateFile).Save("Aspose.Words.Demos.pdf", Aspose.Words.SaveFormat.Pdf, Aspose.Words.SaveType.OpenInBrowser, Response);

The new version does not support SaveType.OpenInBroswer (Save method only takes in 2 params now). New code looks like this:

translator.AsposeWordsDocument(true, letterTemplateFile).Save("sample.pdf", new PdfSaveOptions());

Is there a way to specify that I want this to just open in a new popup/window? Perhaps I should use a different method altogether?

Thanks in advance!

Hi there,

Thanks for your inquiry. Please refer to the following article and check following code example. Hope this helps you.
Sending to a Client Browser

Document doc = new Document(MyDir + "Document.doc");
// If this method overload is causing a compiler error then you are using the Client Profile DLL whereas 
// the Aspose.Words .NET 2.0 DLL must be used instead.
doc.Save(Response, "Report Out.pdf", ContentDisposition.Inline, null);

Thank you!! This was very helpful and solved the problem.