Welcome to the Alfresco Builder Network

Our technical resource site is still being improved. We'd love to hear your feedback. Tell us what you think

Retrieves an SVG thumbnail image to represent a document type.

Class members

Methods

  • getDefaultMimeTypeIcon(): string
    Gets a "miscellaneous" thumbnail URL for types with no other icon defined.
    • Returns string - URL string
  • getDocumentThumbnailUrl(node: any): string
    Gets a thumbnail URL for the given document node.
    • node: any - Node to get URL for.
    • Returns string - URL string
  • getMimeTypeIcon(mimeType: string): string
    Gets a thumbnail URL for a MIME type.
    • mimeType: string - MIME type for the thumbnail
    • Returns string - URL string

Details

The service can locate a thumbnail icon (in SVG format) for either a document node or a MIME type. The default mapping between types and icons is shown in the table below:

DocumentIconTypes
Compressed archiveArchive thumbnail'application/x-compressed', 'application/x-zip-compressed', 'application/zip'
TextText thumbnail'text/plain', 'application/json', 'application/x-javascript', 'application/vnd.apple.pages'
Bitmap/raster imageBitmap thumbnail'image/png', 'image/jpeg', 'image/gif'
MP4 videoMP4 thumbnail'video/mp4'
SVG vector imageSVG thumbnail'image/svg+xml'
HTML fileHTML thumbnail'text/html'
PDF filePDF thumbnail'application/pdf'
FolderFolder thumbnail
Disabled folderDisabled folder thumbnail
Excel spreadsheetSpreadsheet thumbnail'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template'
PowerPoint slideshowPowerPoint thumbnail'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.openxmlformats-officedocument.presentationml.template', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow'
Word documentWord thumbnail'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template'
Keynote presentationKeynote thumbnail'application/vnd.apple.keynote'
Numbers spreadsheetNumbers thumbnail'application/vnd.apple.numbers'

Mat-icon

All the ADF icons for MIME types are now registered into the MatIconRegistry, so you can use all the icons via the <mat-icon> tag:

import { ThumbnailService } from '@alfresco/adf-core';

constructor(public thumbnailService: ThumbnailService) {
}‍‍‍‍‍‍‍‍
MP4 <mat-icon svgIcon="video/mp4"></mat-icon>
PDF <mat-icon svgIcon="application/pdf"></mat-icon>
GIF <mat-icon svgIcon="image/gif"></mat-icon>
.....

See also

Interested in trying Alfresco?

Try Now