Page 1 of 1

[ANGULAR] export PDF not download file

Posted: Thu Apr 08, 2021 10:58 am
by kenken9301680

Hello friends,

I have an issue about PDF export, I am seeing your export function by default when exporting will return the url and download that file, how can I just return the url without downloading the file? .


Re: [ANGULAR] export PDF not download file

Posted: Thu Apr 08, 2021 12:23 pm
by Maxim Gorkovsky

Hello.
You can set this config to false: https://bryntum.com/docs/gantt/#Gantt/feature/export/PdfExport#config-openAfterExport
to get PDF url you can listen to export event:

gantt.features.pdfExport.on({
  export({ response }) {
    console.log(response.parsedJson.url); // PDF's URL
  }
})

Please be aware that export server removes file after about 10 seconds. Feel free to refactor that part in src/server/WebServer.js#setFile