I’m creating a MVC Web Application. I’m having requirement that, when I click on print button, I want to preview the content in ASPOSE Preview.
I am new to aspose, Very first, is it possible? If yes then how can achieve this?
Hi Sachin,
Thanks for your inquiry. Please note Aspose.Words is a class library. It does not offer UI or web control for document preview. However in a web application to preview a document. you can convert your document to images using Aspose.Words and later can show it in a web page for preview.
Document document = new Document(“In.docx”);
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.Jpeg);
options.PageCount = 1;
// Save each page of the document as Jpeg.
for (int i = 0; i < document.PageCount; i++)
{
options.PageIndex = i;
document.Save(string.Format(“out_{0}.jpg”, i), options);
}
Please feel free to contact us for any further assistance.
Best Regards,