How to display PDF (Blob) on iOS sent from my angularjs app
<p>My Angular 1.5 application connect to a Java/Tomcat/Spring backend server via REST.</p>

<p>One REST service generates PDF and send it to the client. It works fine on DEsktop browsers (FF, Chrome at least) but <strong>I cannot see the PDF content on iOS (ipad for instance) whatever the browser I am using (Chrome, Safari..)</strong></p>

<p>Here is the Angular Code :</p>

<pre><code>$http.get("/displayPdf", {responseType: 'arraybuffer', params: {id: 1}}).
 success(function(data) {
   var blob = new Blob([data], {type 'application/pdf'});
   var objectUrl =  window.URL.createObjectURL(blob);
   window.open(objectUrl);
 }
);
</code></pre>

<p>The Spring/Jax-RS code is : </p>

<pre><code>@GET
@Path("displayPdf")
@Produces("application/pdf")
Response displayPdf(@QueryParam("id") Long id) {
  byte[] bytes = service.generatePdf(); 
  return javax.ws.rs.core.Response.ok().
    entity(bytes).
    header("Content-Type", "pdf").
    header("Content-Disposition", "attachment; filename='test.pdf'").
    build();
}
</code></pre>

<p>I have done my research here for instance(<a href="https://stackoverflow.com/questions/21628378/angularjs-display-blob-pdf-in-an-angular-app">AngularJS: Display blob (.pdf) in an angular app</a>) but could not find an appropriate solution.</p>

<p>So please, do you know what should I do to display the generated PDF to my iPad/iPhone end-users ?</p>

<p>Thanks a lot</p>