Open PDF and edit on top of it

I had a requirement that user need to prompt to open a pdf and performs some paint like functionality on it and save it.

I have started with viewer in PDF.Js and performing freehand on the created canvas.

But when i choose download it is only downloading the rendered one not the latest canvas.

Please help me out.