Export to PDF /PPT

I want a script to export PDF and PPT on a button click.

I tried scripts available on website:
https://www.dundas.com/support/developer/script-library/export/page-2

The PDF script did not work and ppt script work but the output was generated in export window. How can I directly download the exports ?

You need to grab the object returned from the export and force the browser to download it.

Have a look at the code from line 95 to the end of this example https://www.dundas.com/support/developer/script-library/export/create-a-pdf-export

If that’s not working for you - check your browser settings, it could be blocking popup or file downloads from the site