webfactorymk/ng2-canvas-whiteboard

Optional file name in downloadCanvasImage()

Closed this issue · 3 comments

It would be nice to have a possibility to provide the file name as a param.

Hi, sorry for late response,

Yes version 1.4.7 will add this parameter as the third parameter (name: customFileName) for the method. It will be optional.

Also an input will be added with the name downloadedFileName if you want the canvas save button to save with a custom filename.

If the download method

(downloadCanvasImage(returnedDataType?: string, downloadData?: string | Blob, customFileName?: string): void;)

is called programatically, file name priority will be in the next order:

  1. The third parameter for the customFileName+.ext
  2. The input parameter for the downloadedFileName+.ext
  3. The autogenerated param with the valueOf the current Date ("canvas_drawing_" + new Date().valueOf()+.ext)

Please check if everything is okay so that we may close this issue.

I will close this issue for now but if there are any issues please feel free to open another one.