| FoxitPDFSDKforWeb v11.0.5 Archives Foxit PDF SDK for Web

Public Member Functions | List of all members
DownloadFileService Class Reference

A service to download files. More...

## Public Member Functions
| downloadCurrentPDF (fileName)
| Download the current openning PDF file to local disk. More...
| downloadFile (fileData, fileName)
| Download the file to local disk. More...

## Detailed Description

A service to download files.

Example
  const {DownloadFileService} = UIExtension.services;
  const downloadFileService = pdfui.getServiceInstance(DownloadFileService);
  downloadFileService.downloadCurrentPDF();

## Member Function Documentation

## ◆ downloadCurrentPDF()

DownloadFileService::downloadCurrentPDF | ( |  | fileName | ) |
| inline

Download the current openning PDF file to local disk.

Parameters

  fileName | string Re-specify the file name. Using PDFDoc.getFileName method in the case of not specified。 But if PDFDoc.getFileName() returns an empty string, the file name will be specified as 'download.pdf'。

Returns
  Promise<void>

## ◆ downloadFile()

DownloadFileService::downloadFile | ( |  | fileData,
|  |  | fileName
| ) |  |
| inline

Download the file to local disk.

Parameters

  fileData | Blob|TypedArray|ArrayBuffer[] The file data stream.
  fileName | string The file name after download, this parameter may not working in some platform like: IOS, Mac

@2025 Foxit Software Incorporated. All rights reserved.