eckhchri / pcars-ds-liveview

Provides a html page for project cars dedicated server and display a map of the current race.
14 stars 1 forks source link

Exported pdf cannot be saved #123

Closed viper4gh closed 6 years ago

viper4gh commented 6 years ago

If you use an export button and have the export configured to pdf then a new browser tab is opened with the pdf. You can now save the pdf file. But if you close the liveview tab and go back to the pdf tab then the file is not available on the webserver anymore and cannot be saved. The browser throws a network error.

viper4gh commented 6 years ago

Maybe use download instead of open, which means that a "Save as" dialog pops up instead of a new tab.

Doku: http://pdfmake.org/#/gettingstarted pdfMake.createPdf(docDefinition).download('optionalName.pdf');

Maybe the name can be dynamic created with date,time, trackname, number of laps ...

https://github.com/eckhchri/pcars-ds-liveview/blob/master/index.html#L1295 https://github.com/eckhchri/pcars-ds-liveview/blob/master/index.html#L1787 https://github.com/eckhchri/pcars-ds-liveview/blob/master/index.html#L1829

viper4gh commented 6 years ago

With the new implementation the problem cannot happen anymore.