Skip to main content

PDF Viewer component

Displays a PDF.

Properties

All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Configurability Inspector > Appearance > Hidden
Defaultfalse
Examples
true

mobileOfflineAssetId

A user-defined identifier for the underlying cached PDF.

Type string
Formatstring
Configurability Inspector > Content > PDF source > Offline Asset
Defaultnull
Examples
test_asset
pdf_1

retoolFileObject

The file's data when using a file not stored in Retool Storage.

Type object
Configurability Read-only
Defaultnull
Object Properties

base64Data

The base64 encoded data of the file.

Type string
Configurability Read-only
Defaultnull

sizeBytes

The size of the file in bytes.

Type number
Configurability Read-only
Defaultnull

type

The MIME type.

Type string
Configurability Read-only
Defaultnull

name

The file name.

Type string
Configurability Read-only
Defaultnull

Examples
{
"name": "sample.pdf",
"type": "application/pdf",
"sizeBytes": 10523,
"base64Data": "JVBERi0xLjQKJeLjz9...G"
}

retoolStorageFileId

The unique identifier for a file in Retool Storage.

Type string
FormatUUID
Configurability Inspector > Content > File input
Defaultnull

showRotateButton

Whether to show the rotate button.

Type boolean
Format True/False
Configurability Inspector > Content > Add-ons > Rotate button
Defaultfalse


showZoomControls

Whether to show the zoom controls.

Type boolean
Format True/False
Configurability Inspector > Content > Add-ons > Zoom controls
Defaultfalse

src

The data source.

Type string
Formatstring
Configurability Inspector
Defaultnull
Examples
https://upload.wikimedia.org/wikipedia/commons/1/14/Marspathfinder.pdf

srcType

The source type of the PDF. Depending on the value of this field, we will use different properties for the PDF source

Type string
Configurability Inspector > Content > PDF source
Allowed Values
ValueDescription
src

URL.

retoolStorageFileId

Retool Storage file.

retoolFileObject

Retool file object.

mobileOfflineAsset

A user-defined identifier for the underlying cached PDF.

storageBlobId

Storage blob.

Defaultnull

title

The title text to display.

Type string
Configurability Inspector
Defaultnull

viewMode

Whether the PDF is scrollable within a smaller container, or the device screen.

Type string
Configurability Inspector > Appearance > View mode
Allowed Values
ValueDescription
page

The view is scrollable within the device screen.

document

The view is scrollable within a smaller container.

Defaultnull