FoxitPDFSDKforWeb v10.0.0
Foxit PDF SDK for Web
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
fileNamestring 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
fileDataBlob|TypedArray|ArrayBuffer[] The file data stream.
fileNamestring The file name after download, this parameter may not working in some platform like: IOS, Mac

Foxit Software Corporation Logo
@2025 Foxit Software Incorporated. All rights reserved.