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

Free Support Forum - aspose.com

To open documents in browser

Hi,


I want to open up a word document in the browser using Aspose.
We are using MVC architecture, asp.net, vb.net technology.
Can you please send us some sample code to do this from vb.net ?

Thanks
Chitra K

Hi Chitra,


Thanks for your inquiry. Aspose.Words for .NET is just a class library and with it you can programmatically generate, modify, convert, render and print documents without utilizing Microsoft Word®. So, it does not offer any UI or web control for performing these document processing tasks on web pages.

Our sister company GroupDocs.com offers a viewer app which you may consider including in your application to view the various file formats. With GroupDocs apps, you can also have limited editing functionalities. For more information, we suggest you please contact GroupDocs support through live chat or support forums of GroupDocs.

Moreover, if you just want to view pages in web browser, you can convert all pages in your Word document to images and then display them. Here is how you can convert pages to images:


Document doc = new Document(MyDir + @“in.docx”);

<o:p> </o:p>

ImageSaveOptions opts = new ImageSaveOptions(SaveFormat.Png);<o:p></o:p>

opts.PageIndex = 0;<o:p></o:p>

opts.PageCount = doc.PageCount;<o:p></o:p>

opts.PageSavingCallback = new HandlePageSavingCallback();<o:p></o:p>

<o:p> </o:p>

doc.Save(MyDir + @“16.3.0.png”, opts);<o:p></o:p>


private class HandlePageSavingCallback : IPageSavingCallback<o:p></o:p>

{<o:p></o:p>

public void PageSaving(PageSavingArgs args)<o:p></o:p>

{<o:p></o:p>

args.PageFileName = string.Format(MyDir + @“Page_{0}.png”, args.PageIndex);

}<o:p></o:p>

}<o:p></o:p>


Hi Tahir,

Thanks for the reply.
I tried Microsoft.Office.Interop.Word.Application and it worked fine.
Thanks for suggesting GroupDocs.com and we will consider it for our other projects.

Thanks
Chitra Krishnan