Skip to content Skip to sidebar Skip to footer

How To Display A Pdf Document Within An Iframe By Google Docs Viewer Stored In Firebase Storage?

I have an iframe in which I want to put a preview of my pdf document hosted in firebase storage through google docs viewer. I am creating the html view in javascript dynamically an

Solution 1:

I just had to encode the URI and change the '%26' to '&':

var encodedUrl = encodeURIComponent(downloadUrlFirebaseStorage);

....making  my html on the fly in javascript

myHtml+='<iframe src="https://docs.google.com/viewer?url='+encodedUrl+'&embedded=true" width="100%"   frameborder="0"/>'

....making remaining  rest of my html on the fly in javascript

$('.someClass').html(myHtml);

Post a Comment for "How To Display A Pdf Document Within An Iframe By Google Docs Viewer Stored In Firebase Storage?"