Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jspdf converted pdf save to server

var doc = new jsPDF();
$('#generatereport').click(function()
{
    doc.fromHTML(
        $('#lppresults'), 15, 15,
        {width: 170},
        function()
        {
            var blob = doc.output('blob');

            var formData = new FormData();
            formData.append('pdf', blob);

            $.ajax('/upload.php',
            {
                method: 'POST',
                data: formData,
                processData: false,
                contentType: false,
                success: function(data){console.log(data)},
                error: function(data){console.log(data)}
            });
        }
    );
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jspdf #converted #pdf #save #server
ADD COMMENT
Topic
Name
3+7 =