Wednesday, 24 January 2018

Html to pdf convert jquery

<!DOCTYPE html>
<html>

    <head>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

        <title>jquery - Download a div in a HTML page as pdf using javascript - Stack Overflow</title>
</head>
<body>
<div id="content">
     <h3>Hello, this is a H3 tag</h3>

    <p>a pararaph</p>
</div>
<div id="editor"></div>
<button id="cmd">generate PDF</button>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/0.9.0rc1/jspdf.min.js"/></script>
<script>
var doc = new jsPDF();
var specialElementHandlers = {
    '#editor': function (element, renderer) {
        return true;
    }
};

$('#cmd').click(function () {
    doc.fromHTML($('#content').html(), 15, 15, {
        'width': 170,
            'elementHandlers': specialElementHandlers
    });
    doc.save('sample-file.pdf');
});

</script>
</body>
</html>

Thursday, 21 September 2017

Parse server backup from heroku


/**********************************************************************************
//Installation parse server
install nodejs above 4.3
install mongodb


Heroku install on local
//install heroku
gem install heroku
//login to terminal enter email id and password
heroku login


//clone app on local machine
heroku git:clone -a your_app_name

//run parse server
cd app_direc >> run npm install commond >> npm start