Free Support Forum - aspose.com

Web based document viewer using Aspose Total

Hi,

I would like to implement a web based document viewer using Aspose Total. Mainly I would like to be able to preview .pdf, .doc, .docx, .ppt, .pptx, .xls, .xlsx. There is a way to convert a native document to an image to be able to display it in browser? I would also like to get the number of pages to be able to navigate. A thumbnail of the page would be great. Can you please point me to the right direction?

Thank you,

Craig Matthews

Hi,

I am a representative of Aspose.Cells product that supports the feature to convert Excel files (XLS/XLSX) to images. You may utilize SheetRender APIs to make images for the sheets (in the Workbook) and also can create thumbnails for your need.

See some documents for your reference:
Generate Thumbnail of the Worksheet
Converting Worksheet to Image

Thank you.

Hi Craig,

I represent Aspose.PDF and I would like to share with you that you can convert pages of a PDF file to images and then view those images using any image control; please read this article. You can also get total number of pages by determining Count of Document.Pages Collection. As far as your question related to the thumbnails is concerned, I would like to inform you that you can use the overload which allows you to specify the output image’s height and width.

I hope this helps. If you have any further questions, please do let us know.
Regards,

@CraigMatthews

Thanks for your inquiry.

I am representative for Aspose.Words. Aspose.Words is able to load and render .doc and .docx files to any image format. For a full list of supported formats please see here:
Supported Document Formats

You can convert any document loaded into Aspose.Words to the image formats: Tiff , Png , Bmp , Emf or Jpeg as described here by calling the Save method, and optionally passing an ImageSaveOptions object to define custom settings.

The number of pages in a document can be retrieved by calling the Document.PageCount method. You can view sample code for rendering document pages to thumbnails by viewing the second example on the Document.RenderToScale API page.

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 document = new Document(@"C:\test\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(@"C:\test\out_{0}.jpg", i), options);
}

If you have any further queries, please feel free to ask.

What about PowerPoint (ppt, pptx). Any articles?

Hi Craig,

I am representative of Aspose.Slides.

Aspose.Slides can help you in generating the slide thumbnails for PPT or PPTX presentations and depicting those generated thumbnails in web pages. Please proceed to this link to see how to generate the slide thumbnails. Please share with us, if you may have any further queries.

Thanks and Regards,

Hi Amjad Sahi,


I need to viewer an existing Excel in web browser. Is there any control to view full excel sheet in web browser like spreadsheet?..Bcz i am also want to edit the file.

Hi Ramesh Kumar,


Well, I think you may try to use our Aspose.Cells.GridWeb control - A grid control that is specifically designed to be used on web environments or in Asp.NET projects. It is an independent control where you may load Excel files into its grid matrix, create/design worksheets and update/ manipulate the data into the cells in WYSIWYG (visual) manner. It supports all the main features MS Excel if not everything though. It also supports to read/write and calculate formulas too. It can load and save/re-save the files to Excel files on the fly, everything in your browser type. Please see the documents / articles for your reference:

You may also check the featured GridWeb demos/examples here:

Hope, this helps a bit.

Thank you.