'Save PDF to specific folder using JSPDF (JavaScript)

I'm using JSPDF to convert HTML to pdf and I want to send it over email. For that, I need to store the file in the folder. But I'm not able to store it on the folder as "jspdf.save('filename.pdf')" does not give option for path.

    var pdf = new jsPDF('p', 'pt', 'letter'),
    source = $("#printFavorites").html();
    specialElementHandlers = {
        // element with id of "bypass" - jQuery style selector
        '#bypassme': function (element, renderer) {
            // true = "handled elsewhere, bypass text extraction"
            return true
        }
    };
    margins = {
        top: 0,
        bottom: 0,
        left: 30,
        width: 522
    };

    pdf.fromHTML(
        source,
        margins.left,
        margins.top, {
            'width': margins.width,
            'elementHandlers': specialElementHandlers
        },
        function (dispose) {
            pdf.save('filename.pdf'); // Not able to attach path
        }, margins
    );

I want to store this file somewhere on the folder. Is there any way I can do this here?

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source