Previews or Thumbnail Images for macOS 10.14 or Earlier

Create thumbnail images or previews of common files and custom file types on earlier versions of macOS.

Overview

The QuickLook framework provides functionality to create a miniature representation, or thumbnail, of a file and its contents for display in apps that target macOS 10.14 and earlier.

If your app targets macOS 10.15 and later, use the QuickLookThumbnailing framework to create thumbnails. Similarly, use a Quick Look Preview extension to display previews of files instead of Quick Look generators. To learn more, watch What’s New in File Management and Quick Look.

Topics

Creating Thumbnails

QLThumbnailImageCreate

Creates a thumbnail image for the specified file.

QLThumbnailCreate

Returns a thumbnail that’s generated in the background.

Deprecated
QLThumbnailDispatchAsync

Creates a thumbnail in the background on the provided background queue.

Deprecated
QLThumbnailCancel

Cancels the computation of the thumbnail.

Deprecated
QLThumbnailCopyDocumentURL

Returns the URL of the document that you’re requesting a thumbnail for.

Deprecated
QLThumbnailCopyImage

Returns a thumbnail image.

Deprecated
QLThumbnailCopyOptions

Returns the options for the requested thumbnail.

Deprecated
QLThumbnailGetContentRect

Returns the rectangle of the provided thumbnail image that represents the content of the document.

Deprecated
QLThumbnailGetMaximumSize

Returns the maximum allowed size for the provided thumbnail image.

Deprecated
QLThumbnailGetTypeID

Returns the type identifier for the thumbnail’s opaque type.

Deprecated
QLThumbnailIsCancelled

Returns whether the creation of the thumbnail was canceled.

Deprecated

Handling Thumbnail Requests

QLThumbnailRequestCopyContentUTI

Returns the UTI for the thumbnail request.

Deprecated
QLThumbnailRequestCopyOptions

Returns the options specified for the thumbnail request.

Deprecated
QLThumbnailRequestCopyURL

Returns the URL of the document for which the thumbnail request is requested.

Deprecated
QLThumbnailRequestCreateContext

Creates a graphics context to draw the thumbnail in.

Deprecated
QLThumbnailRequestFlushContext

Flush the graphics context and sets the thumbnail response.

Deprecated
QLThumbnailRequestGetDocumentObject

Returns the object that’s stored as part of a thumbnail request.

Deprecated
QLThumbnailRequestGetGeneratorBundle

Get the bundle of the generator receiving the thumbnail request.

Deprecated
QLThumbnailRequestGetMaximumSize

Returns the maximum size (in points) specified for the thumbnail image.

Deprecated
QLThumbnailRequestGetTypeID

Gets the type identifier for the QLThumbnailRequest opaque type.

Deprecated
QLThumbnailRequestIsCancelled

Returns whether the thumbnail request has been cancelled by the client.

Deprecated
QLThumbnailRequestSetDocumentObject

Stores an object as part of a thumbnail request.

Deprecated
QLThumbnailRequestSetImage

Sets the thumbnail request to a specified image.

Deprecated
QLThumbnailRequestSetImageAtURL

Sets the thumbnail request to contain the image at a given URL.

Deprecated
QLThumbnailRequestSetImageWithData

Sets the response to the thumbnail request to image data saved within the document.

Deprecated
QLThumbnailRequestSetThumbnailWithDataRepresentation

Sets the default image representation for an item with the provided data and specified file type.

Deprecated
QLThumbnailRequestSetThumbnailWithURLRepresentation

Sets the default image representation for an item of a given type at the specified URL.

Deprecated

Requesting Previews

QLPreviewRequestCopyContentUTI

Returns the UTI for the preview request.

Deprecated
QLPreviewRequestCopyOptions

Returns the options specified for the preview request.

Deprecated
QLPreviewRequestCopyURL

Returns the URL of the document for which a preview is requested.

Deprecated
QLPreviewRequestCreateContext

Creates a graphics context to draw the preview in.

Deprecated
QLPreviewRequestCreatePDFContext

Creates a PDF context suitable to draw a multi-page preview.

Deprecated
QLPreviewRequestFlushContext

Flush the context and sets the preview response.

Deprecated
QLPreviewRequestGetDocumentObject

Returns the object that’s stored as part of a preview request.

Deprecated
QLPreviewRequestSetDocumentObject

Stores an object as part of a preview request.

Deprecated
QLPreviewRequestGetGeneratorBundle

Get the bundle of the generator receiving the preview request.

Deprecated
QLPreviewRequestGetTypeID

Gets the type identifier for the QLPreviewReqest opaque type.

Deprecated
QLPreviewRequestIsCancelled

Returns whether the preview request has been cancelled by the client.

Deprecated
QLPreviewRequestSetDataRepresentation

Sets the preview request to data saved within the document or to dynamically generated data.

Deprecated
QLPreviewRequestSetURLRepresentation

Sets the contents of the file at the given URL as the response to the preview request.

Deprecated

Configuring the Appearance of PDF Previews

QLPreviewPDFStyle

A value you use to configure the appearance of previews for PDF files.

Opaque Types

QLThumbnailRef

An opaque reference representing a thumbnail object.

QLThumbnailRequestRef

An opaque reference representing a thumbnail request object.

QLPreviewRequestRef

An opaque reference representing a preview request object.

Constants

kQLReturnMask

The Quick Look generator can create a preview.

kQLReturnHasMore

The Quick Look generator has more content to display as part of the preview.

kQLThumbnailOptionIconModeKey

The Quick Look generator produces the thumbnail as an icon with decor.

kQLThumbnailOptionScaleFactorKey

The scale factor for the thumbnail.

Deprecated Constants

kQLPreviewContentIDScheme

The content ID URL scheme.

Deprecated
kQLPreviewPropertyAttachmentDataKey

Attachment data for a preview.

Deprecated
kQLPreviewPropertyAttachmentsKey

A list of attachments or sub-resources.

Deprecated
kQLPreviewPropertyBaseBundlePathKey

A path that’s outside of the default security scope for creating a preview.

Deprecated
kQLPreviewPropertyDisplayNameKey

A custom display name for the preview panel.

Deprecated
kQLPreviewPropertyHeightKey

The height in points of the preview.

Deprecated
kQLPreviewPropertyMIMETypeKey

The web content or attachment mime type.

Deprecated
kQLPreviewPropertyPDFStyleKey

The preferred way to display PDF content.

Deprecated
kQLPreviewPropertyStringEncodingKey

The string encoding of the preview data.

Deprecated
kQLPreviewPropertyTextEncodingNameKey

The encoding of the web content or attachment text.

kQLPreviewPropertyWidthKey

The width in points of the preview.

Deprecated
kQLThumbnailPropertyBadgeImageKey

An image to use for generating the badge for a file’s icon.

Deprecated
kQLThumbnailPropertyBaseBundlePathKey

A path that’s outside of the default security scope for creating a thumbnail.

Deprecated
kQLThumbnailPropertyExtensionKey

The extension to use as a badge when creating an icon.

Deprecated

See Also

Previews and Thumbails

QLPreviewController

A specialized view controller for previewing an item.

QLPreviewItem

A protocol that defines properties you implement to make your application’s content visible in a preview.

QLPreviewingController

A protocol for implementing a custom controller to create previews of files.