---
title: Optimizely PDF Preview
slug: cms-13/docs/optimizely-pdf-preview
createdAt: 2026-08-07T16:46:23.789Z
---

Optimizely PDF Preview lets editors preview PDF documents directly in the edit view, removing the need to download files for review. PDF Preview is useful for websites where you manage multiple content items in PDF format.

In the edit view, select a PDF document from a media folder to preview its content.

The PDF viewer displays in the language that you select for your CMS user interface.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/8lBcbxoBrScnQIHLQKKLX_22ef356-pdf-preview.png)

In the `PdfPreview` package, there is a class named `PdfFile` which handles uploaded files with the .pdf extension.

## Requirements

- No additional license fee for the add-on.
- An Optimizely Content Management System (CMS) installation, version 13.2.0 or later 13.x, with the *EPiServer.PdfPreview* package installed.
- .NET 10.
- See [Apps platform compatibility](https://docs.optimizely.com/cms-13/docs/apps-platform-compatibility) for package and version information.

## Install

Install the [EPiServer.PdfPreview](https://nuget.optimizely.com/package/?id=EPiServer.PdfPreview) NuGet package, version 13.0.0 or later, in your CMS 13 project. Earlier versions of the add-on do not work with CMS 13.

## User scenarios

Choose the scenario that matches your solution to enable PDF preview.

### The system does not have a model for handling PDF files

If the system does not have a model for handling PDF files, the default `PdfFile` model provided by the package is used. Editors can now preview PDF files in edit view without any extra steps.

### The system already has a model for handling PDF files

By default, the `ContentMediaResolver` class from CMS Core gets the first matching media implementation type registered for an extension. If there is an existing type registered for “pdf,” the `PdfFileMedia` implementation in the Optimizely package is used, but the existing type should be chosen in this case.

To change this default behavior, a media resolver class named `PdfContentMediaResolver` is used to ignore the `PdfFile` type in the Optimizely package, and thus, the existing registered media type is the candidate.

`PdfContentMediaResolver` inherits `ContentMediaResolver` and overrides the Type `GetFirstMatching(string extension)` method to handle the business logic above.

To turn on the PDF preview, the PDF media model must implement the `IPdfFile` interface. For example:

```csharp
[ContentType(DisplayName = "PdfFile", GUID = "…", Description = "")]
[MediaDescriptor(ExtensionString = "pdf")]
public class PdfFile: MediaData, IPdfFile {}
```

:::hint{type="info"}
**Note**
Due to limitations, after installing the add-on, you can preview only newly uploaded PDFs. You must upload existing PDFs again to be previewed.
:::
