This works well now that chrome has removed top frame navigation. Only downloading the pdf in chrome gives problem. Download works in well in firefox tho.
var string = doc.output('datauristring');
var iframe = "<iframe width="100%" height="100%" src="" + string + ""></iframe>"
var x = window.open();
x.document.open();
x.document.write(iframe);
x.document.close();