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

Free Support Forum - aspose.com

Fast Word rendering possibilities

Hi Aspose,
fast browsing Word documents by previewing bitmaps generated with your Aspose.Words.Viewer classes is an important feature in our application. But unfortunately the rendering often isn’t close to like Word itself would display the document. I.e. the rendering is very inaccurate and you don’t see what you get in the end.
As I often read in this forum your Renderer classes are in “beta” state and under construction (for many years now). Is there any chance that this will change in near future? If not: Is there another way (perhaps with some other products of yours) to generate accurate previews fast and in-memory (stream-to-stream) of the Word documents?
Best
Jörg

Hi
Thank you for your interest in Aspose.Words. Yes, unfortunately Aspose.Words.Viewer namespace is still in beta. I can’t provide you any reliable estimate when this functionality will be finished.
As a workaround you can convert your document to PDF using Aspose.Words and Aspose.Pdf and then extract PDF pages as images using Aspose.Pdf.Kit.
Best regards.

Hi,
but that is not an in-memory solution, is it? As I understood from your online-documentation I would have to save data to disk and read it back to memory to accomplish the conversion…
Best
Jörg

Hi
Thanks for your inquiry. You can do this in memory. See the following code:

// Open word document
Document doc = new Document(@"Test303\in.doc");
// Save documetnt in Indermediate XML 
MemoryStream pdfXmlStream = new MemoryStream();
doc.Save(pdfXmlStream, SaveFormat.AsposePdf);
// Create Pdf document 
Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
pdf.BindXML(pdfXmlStream, null);
pdf.IsImagesInXmlDeleteNeeded = true;
// Save Pdf to stream
MemoryStream pdfStream = new MemoryStream();
pdf.Save(pdfStream);
// Ceate PdfConvertor
Aspose.Pdf.Kit.PdfConverter converter = new Aspose.Pdf.Kit.PdfConverter();
converter.BindPdf(pdfStream);
converter.DoConvert();
int imageCount = 1;
while (converter.HasNextImage())
{
converter.GetNextImage(string.Format(@"Test303\outimage_{0}.png", imageCount), ImageFormat.Png);
imageCount++;
}

Hope this helps.
Best regards.

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