I have following code.In which when I click on 'print map' button then popup window gets open on which there are two buttons 'save' and 'print'. when I click on 'save' button it opens window to save file.
What I want is when I click on 'print map' button then window after clicking save button should open.
function PrintElem(elem)
{
    Popup($(elem).html());
}
function Popup(data) 
{
    var mywindow = window.open('', 'parent', 'height=400,width=600');
    mywindow.document.write('<html><head><title>my div</title>');
    /*optional stylesheet*/ //mywindow.document.write('<link rel="stylesheet" href="main.css" type="text/css" />');
    mywindow.document.write('</head><body >');
    mywindow.document.write(data);
    mywindow.document.write('</body></html>');
    mywindow.document.close(); // necessary for IE >= 10
    mywindow.focus(); // necessary for IE >= 10
    mywindow.print();
    mywindow.close();
    return true;
}<script src="http://cdnjs.cloudflare.com/ajax/libs/jspdf/0.9.0rc1/jspdf.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="http://html2canvas.hertzen.com/build/html2canvas.js"></script>
<body>
    <section>
        <div class="main_div">
            <div>
                <div class="nav_div">
                    <input type="button" value="Print Map"  onclick="PrintElem('.parent')" />
                </div>          
            </div>  
            <div class="parent">    
                    <h1>Hello All</h1>  
            </div>
        </div>
    </section>
</body>
              
     
    