Free Support Forum - aspose.com

Generic Interface

I am evaluating Aspose.Total for Java for the purposes of creating thumbnail images. Our company has a system that contains a large number of documents in various file formats (pdf, jpg, doc, docx, ppt, pptx, xls, xlsx, html). I would like to be able to produce thumbnails of these documents to display on a web page.

I am given a byte array and a MIME type string along with output parameters like a height and width in pixels, and an image format (png, jpg, gif). It appears that each of the Aspose libraries (Cells, PDF.kit, Words, etc) have ways to convert their respective document types to images, but there is no generic way to deal with documents. In other words, it looks like I will have to use the MIME type to detect the document type and load up the appropriate Aspose library for thumbnail conversion as opposed to having Aspose detect this on it’s own. Is this true?

Hi Jake,


Thanks for contacting support.

We have different components to deal with particular file formats and as per your requirement, you need to determine the MIME type of input file and perform conversion to Image format using particular product. Most of our products support the feature to convert source file to PDF format, and you may consider first converting all file formats to PDF format and then try using Aspose.Pdf.Kit for Java to render the pages of PDF file to Image format.
You may either first concatenate all PDF files to single PDF document and render the pages into Image format. For further information, please visit

Hi Jake,


Thanks for your inquiry. Aspose.Words provides FileFormatUtil.detectFileFormat to detect the file format.With FileFormatInfo, you can detect only file formats listed in the following link:
http://www.aspose.com/docs/display/wordsjava/LoadFormat

Once your document is loaded into Aspose.Words DOM, you can easily convert it into specified image by using ImageSaveOptions. Please more detail about ImageSaveOptions from here:
http://www.aspose.com/docs/display/wordsjava/ImageSaveOptions

Hope this answers your query. Please let us know if you have any more queries.

Hi,


I would like to address your issue regarding Aspose.Cells for Java.

Similarly, the product does provide CellsHelper.detectFileFormat() method to detect the file format of the provided Excel file for your needs.

Also, the following document may help you on how to generate thumbnail of the sheet image(s):
http://www.aspose.com/docs/display/cellsjava/Generate+a+Thumbnail+Image+of+a+Worksheet

Thank you.