Export vector graphics from HTML5 canvas
No, It is Immpossible. After the drawing operations are complete, all that's left on
is a bunch of pixels. You will need to save all the drawing parameters and then use them to create a separate vector drawing. If you want to save as a vector, why not create as a vector ?
source to share