Got a solution!!
Create a html file (eg pdf.html) and add
<!DOCTYPE html><html>
<head>
<title></title>
</head>
<body>
<script>
document.location.href = document.location.hash.substr(1);
</script>
</body>
</html>
Create a link
<a class="btn btn-default" id="pdfData" ng-show="isMobile && pdfReady" ref="app/views/pdf.html" target="xxx">
Download PDF
</a>
After you "rendered" your pdf get the datauristring
and add it to your link as hash.
var pdfData = doc.output('datauristring');
var element = document.getElementById('pdfData');
element.href = "app/views/pdf.html#" + pdfData;
element.target = "xxx";
$scope.pdfReady = true; // show download link
And now if the user clicks the download link a new window is opened in safari and the pdf get shown
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…