Metadata-Version: 2.4
Name: djangocms_embedpdf
Version: 1.0.1
Summary: 
License: MIT
License-File: LICENSE
Author: Kapt dev team
Author-email: dev@kapt.mobi
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: Django (>=3.2,<4.0)
Requires-Dist: django-cms (>=3.11,<4.0)
Requires-Dist: django-filer (>=3,<4)
Project-URL: Repository, https://gitlab.com/kapt/open-source/djangocms-embedpdf
Description-Content-Type: text/markdown

# djangocms-embedpdf

django CMS plugin to embed a PDF from [django-filer](https://github.com/django-cms/django-filer) directly into a page, using the [EmbedPDF Snippet](https://www.embedpdf.com/docs/snippet/getting-started) viewer.

![preview djangocms_embedpdf](https://gitlab.com/kapt/open-source/djangocms-embedpdf/-/raw/main/preview.png)

## Features

- Pick a PDF from Filer and display it inline
- Configurable viewer height (CSS value, e.g. `80vh`, `600px`)
- Viewer UI localized from the active Django language
- Simplified interface by default (View mode only, with fullscreen in the toolbar)
- Optional override of EmbedPDF disabled UI categories via settings

## Requirements

- Python 3.10+
- Django 3.2+
- django CMS 3.11+
- [django-filer](https://github.com/django-cms/django-filer)

## Installation

```bash
pip install djangocms-embedpdf
```

Add the app to your `INSTALLED_APPS`:

```python
INSTALLED_APPS = [
    # ...
    "filer",
    "djangocms_embedpdf",
]
```

Run migrations:

```bash
python manage.py migrate djangocms_embedpdf
```

## Usage

1. Edit a CMS page.
2. Add the **Embedded PDF** plugin (under **Files**).
3. Select a PDF from Filer and optionally set the viewer height.

The plugin loads EmbedPDF from the CDN and mounts it on the page.

## Configuration

### EmbedPDF JavaScript URL

By default the viewer is loaded from the jsDelivr CDN. Override the script URL with:

```python
DJANGOCMS_EMBEDPDF_JS_URL = "https://cdn.jsdelivr.net/npm/@embedpdf/snippet@2/dist/embedpdf.js"
```

Useful for pinning a version, using a mirror, or serving the file from your own static files.

### Disabled UI categories

By default, editing features are hidden so editors get a read-oriented viewer. You can override this with:

```python
DJANGOCMS_EMBEDPDF_DISABLED_CATEGORIES = [
    "mode-annotate",
    "mode-shapes",
    "mode-redact",
    "annotation",
    "redaction",
    "form",
    "insert",
    "history",
    "document-open",
    "document-close",
    "document-protect",
    "security",
    "panel-comment",
]
```

See the [EmbedPDF customizing UI docs](https://www.embedpdf.com/docs/snippet/customizing-ui) for the full list of categories.

