For the complete documentation index, see llms.txt. This page is also available as Markdown.

PDF Viewer

Open PDF Viewer

SDK function: openPDFViewer

openPDFVieweris a function that opens Base64-encoded PDF data in the native PDF viewer. When the user closes the PDF viewer, 'CLOSE'is returned.

Signature

function openPDFViewer(params: OpenPDFViewerParams): Promise<OpenPDFViewerResult>;

Parameter

  • params required

    It's an object containing the PDF data and file name. For the detailed type, see below OpenPDFViewerParamsPlease refer to it.

Return value

  • Promise<OpenPDFViewerResult>

    When the PDF viewer is closed 'CLOSE'is returned.

Error

Error code
Trigger condition

INVALID_REQUEST

When the request parameters are invalid

INVALID_DATA

When the PDF data is invalid

PDF_VIEWER_ERROR

When an error occurs while opening the PDF viewer

UNSUPPORTED_APP_VERSION

When the Toss app version is lower than 5.261.0

Example

Types · Objects

PDF Viewer Parameters (OpenPDFViewerParams)

openPDFViewer This is the parameter type passed to the function.

Signature

Properties

  • data string required

    It's a PDF data string encoded in Base64.

  • filename string

    It's the PDF file name.

PDF Viewer Result (OpenPDFViewerResult)

This is the result type returned when the PDF viewer is closed.

Signature

Value description

Value
Description

'CLOSE'

This is the case when the user closes the PDF viewer.

Last updated

Was this helpful?