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

Free Support Forum - aspose.com

Preview Document Within Vb.net 2008

Hi,
Is it possible to view the Word document within a container ( form or panel, etc) using Aspose.Words ? (and not open MS Word - similar functionality to the vb6 OLE control)
I have a treeview which lists many documents created, what i would like to do is either preview the document within a container in the hover-over, or, on the double-click…
Any ideas ?
Many Thanks
Mark

Hi
Thanks for your inquiry. I think that you can try using Aspose.Editor. See the following link for more information.
https://products.groupdocs.com/editor/net/
Also if you need preview only then you can try using Aspose.Words.Viewer namespace to convert document to a bitmap array of the pages of the document. But note that Aspose.Words.Viewer is currently in beta. For more information see the following link.
https://docs.aspose.com/words/net/rendering/
Best regards.

Great, Thanks…
Do you have any sample code for the Aspose.Words.Viewer ??
Mark

Hi
You can try using the following code.

Document doc = new Document(@"Test036\in.doc");
DocumentRenderer renderer = new DocumentRenderer(doc);
Bitmap[] arr = renderer.GetPages();
for (int i = 0; i < arr.Length; i++)
{
    arr[i].Save(@"Test036\page_" + i.ToString() + ".jpg", ImageFormat.Jpeg);
}

Best regards.

Wow, thanks for your swift response.
I will try Aspose.Editor AND the Aspose.Words.Viewer and see which is best for my needs.
Thanks
Mark

Hi,
i am receiving error with this code…

Dim doc As New Document("C:\Document.doc")
Dim renderer As New Viewer.DocumentRenderer(doc)
Dim arr As Bitmap() = renderer.GetPages()
For i As Integer = 0 To arr.Length - 1
arr(i).Save("Document\page_" + i.ToString() + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
Next

It occurs on the arr(i).save line, a generic error occurred in GDI+
??
Mark

Please ignore my last post…
I was being stupid !!
Mark

We are happy to tell you that the new Rendering Engine has replaced the “old Viewer Beta”. The Rendering Engine can print, save as images or draw onto .NET Graphics object any document page.

Please see Aspose.Words documentation to learn more about new features.

Saving to image

In additional, new Rendering engine allows you to convert Word document to PDF directly (without using Aspose.Pdf).

Saving to Pdf

The latest version of Aspose.Words is available for download from downloads section or from NuGet