Reputation: 53
We use the following code to read a PDF file from Amazon S3.
S3Object object = client.getObject(new GetObjectRequest(bucket, key));
InputStream is = object.getObjectContent();
Results.ok(is)
However the PDF is rendered as blank.
Could you please provide a code snippet on play with angular to display or render the stream as PDF in the browser.
Upvotes: 2
Views: 1573
Reputation: 119
Have you tried setting the content-type?
return Results.ok(is).as("application/pdf");
Upvotes: 2