Wednesday, September 27, 2017

Show pdf and docx in html using angularjs and AWS S3

I’m working with AngularJS and AWS S3 and I’m trying to view the files(.pdf, .docx, .ppt, etc..) in the browser but I’m stuck.

I’m trying to use the google docs view:

<iframe src="http://docs.google.com/gview?url=MY_AWS_S3_URL&embedded=true"></iframe>

But I’m getting this error in console’s browser and obviously the view of this doc is not working.

Anyone know what is happening? Could be a S3 permissions error or maybe its because angularjs doesn’t support it?

EDIT:
I’ve tried this to show .pdf files and it works but just for .pdf files.

<object width="400" height="500" type="application/pdf" data="your_url" id="pdf_content">
  <p>ERROR!!</p>
</object>

Source: AngularJS



from Angular Questions https://angularquestions.com/2017/09/27/show-pdf-and-docx-in-html-using-angularjs-and-aws-s3/
via @lzomedia #developer #freelance #web

No comments:

Post a Comment