File Preview

A small preview icon is shown for files that have preview functionality available.

File preview works for PDF files and Images (as well as videos if enabled).

Functionality includes:

  • Ability to preview a pdf document before downloading
  • Pagination is available for PDF files, hence multiple pages can be previewed with 'next' and 'back' buttons
  • Includes a download button on the preview lightbox

If a PDF file contains more than one page the preview will show previous and next buttons, in addition to download. For single page previews the forward and next buttons are not shown.

Note: PDF files are transformed into JPEG and JPEG can't handle transparency, hence we add a white background to the image before saving using the JPEG flatten method. This prevents transparent PDF preview images having black backgrounds.


Note: you may require a CORS policy for this to function correctly.

CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in a different domain. CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain.

You can set CORS rules individually for each of the storage services (i.e. blob, file, queue, table). Once you set the CORS rules for the service, then a properly authenticated request made against the service from a different domain will be evaluated to determine whether it is allowed according to the rules you have specified.

CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain

Any request made against a storage resource when CORS is enabled must either have a proper authentication signature


  • allowed origins:
  • allowed methods: GET, PUT
  • allowed headers: x-ms-meta-abc,x-ms-meta-data*,x-ms-meta-target*
  • exposed headers: x-ms-meta
  • max age: 200

For more information see the links below: