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

File.openPDFViewer

Functional API openPDFViewerYou can use the same feature with it as well.

Feature description

Opens Base64-encoded PDF data in the native PDF viewer. When the user closes the viewer 'CLOSE'is returned.

Toss app Android/iOS 5.261.0 You can use it on version and above. Before calling, File.openPDFViewer.isSupported()you can check whether it is supported. If you call it on an unsupported version, UNSUPPORTED_APP_VERSION an error occurs.

Type

File.openPDFViewer(params: OpenPDFViewerParams): Promise<OpenPDFViewerResult>;

Params

type OpenPDFViewerParams = {
  data: string;
  filename?: string;
};

Response

type OpenPDFViewerResult = "CLOSE";

Error code

The error code is the error.code value.

Code
Description

UNSUPPORTED_APP_VERSION

If the running version of the Toss app doesn't support this feature, it occurs immediately upon call. File.openPDFViewer.isSupported()Check in advance with error.messageand, if it occurs, show the user the (update guidance message).

INVALID_REQUEST

The request parameters are invalid.

INVALID_DATA

This is when the PDF data is invalid.

PDF_VIEWER_ERROR

This is when an error occurs while opening the PDF viewer.

Example code

Was this helpful?