Open PDF in seprate windows

Open PDF in seprate windows

I try to Download/open PDF file in separate window but currently PDF file is open in same window

this is what i try

<script type="text/javascript">

      //$(function sumdata() {
      function mypdf() {

          $('#tabledata').tableExport({ type: 'pdf', escape: 'false' });
          window.open(mypdf);
      }
      //});
         
       </script>
<a  href="#"    id="pdf" onclick="mypdf()"   style="background-color: #3399FF;color: #FFFFFF;font-weight: bold;display:none;font-size: medium;PADDING: 15px;margin: 12px;"">EXPORT TO PDF</a>
table export js 
check this link 
http://pastebin.com/FiWKqCEg