---
title: ShortCode Options
description: "DearPDF PDF Viewer plugin for Wordpress uses shortcode to display PDFs. The shortcode can be used in various combinations to achieve your requirements. | Options | Description | Remarks | | --- | --- | --- | | `id` |…"
url: "https://dearpdf.com/docs/shortcode-options/"
updated: "2024-01-12"
category: Customizations
---

# ShortCode Options

DearPDF PDF Viewer plugin for Wordpress uses shortcode to display PDFs. The shortcode can be used in various combinations to achieve your requirements.

| Options | Description | Remarks |
| --- | --- | --- |
| `id` | ID of DearPDF Post or PDF attachment Post | Lite & Pro |
| `source` | Source of the PDF file, Use if id is not available. | Lite & Pro |
| `type` | Sets the type of lightbox(popup) Possible values are `button`, `thumb`, `link`, `custom` | `button` is available in Lite version |
| `viewertype` | Sets the Viewer Type for PDF Viewer. Possible values are `reader` , `flipbook` | Upcoming (PRO) |
| `is3d` | If viewer is flipbook, turns 3D on or off. Possible values are `true`, `false` | Upcoming (PRO) |
| `height` | Sets height of the viewer. Default value is auto. Example values are `100px`, `100%` | Upcoming (PRO) |

---

## id

You can add id of the Wordpress Flipbook post or WordPress PDF attachment post to create PDF viewer using dearpdf shortcode.

Example: `[dearpdf id="12"][/dearpdf]`

```
Id of other posts will not create any viewer. It will result in: ERROR: Set a Valid Document Source.
```

---

## source

Instead of ID, you can add source URL PDF file to create PDF viewer using dearpdf shortcode. *But without ID, share links won't work properly. They cannot open the shared page.*

Example: `[dearpdf source="http://www.abc.com/mypdf.pdf"][/dearpdf]`

```
Make sure the PDF is accessible and has proper CORS access if the file is from different domain.
```

**Demo:**

Viewer from Source

**With custom id:** By using a custom id, non numeric, share URL can retarget the process of opening certain page on load:

`[dearpdf source="https://dearpdf.com/wp-content/uploads/2021/04/glfw.pdf" viewertype="vertical" type="button" id="custom_test_id"]Source Type with custom ID[/dearpdf]`

Source Type with custom ID

---

## type

With type option you can determine what kind of lightbox(popup) trigger will be created.

Example: `[dearpdf id="12" type="button"][/dearpdf]`

Possible values are `button`, `thumb` (PRO), `link` (PRO), `custom` (PRO)

---

## viewertype (PRO)

Sets the Viewer Type for PDF Viewer.

Example: `[dearpdf id="12" viewertype="reader"][/dearpdf]`

Possible values are `reader` , `flipbook`

**Demo:**

Viewer Type Flipbook

Viewer Type Vertical

---

## is3d (PRO)

If viewer is flipbook, turns 3D on or off.

Example: `[dearpdf id="12" viewertype="flipbook" is3d="true"][/dearpdf]`

Possible values are `true`, `false`

---

## height (PRO)

Sets height of the viewer. It only applies to embedded viewer. Lightboxes(buttons/thumb popups) always use 100% height of the browser screen when open in popup.

Example: `[dearpdf id="12" height="500px"][/dearpdf]`

Example values are `100px`, `100%`

---
