Control file downloads in PDF Viewer

16 Oct 20251 minute to read

Use the downloadStart event to intercept the start of a download and optionally cancel it. In the event handler, set args.cancel = true to prevent the download.

pdfviewer.downloadStart = args => {
   // Your custom logic here
   args.cancel = true; // Prevent download action
};

By default, args.cancel is false, so the download proceeds unless explicitly canceled.

Flexibility

Leverage the downloadStart event to apply custom rules for allowing or preventing downloads based on application needs.