使用javascript将pdf下载到项目目录中

i have converted web page into PDF using highchart's js file.i want to store that downloaded file into database as well as in project directory how can i do that?

var click = "return xepOnline.Formatter.Format('JSFiddle', {render:'download'})";
    jQuery('#buttons').append('<button onclick="' + click + '">PDF</button>');