0

I couldnt find answer anywhere so Iam posting the question. How to properly load byte array of pdf file (taken from i.e. Web API) to blob and then generate url based on this blob?

Tried to use this solution: AngularJS: Display blob (.pdf) in an angular app

But I keep getting: Failed to load PDF document.

1
  • Can you clarify your question and create a plnkr? Commented Jan 16, 2015 at 22:07

1 Answer 1

1

Make sure you have set the responseType to arraybuffer i.e. {responseType:'arraybuffer'}

In case of Post:

$http.post('/postUrlHere',{myParams}, {responseType:'arraybuffer'})

In case of Get:

$http.get('/getUrlHere', {responseType:'arraybuffer'})

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.