1

I'm building an app using Cordova/ionic in which I now fetch a PDF from an API (which I am authenticated with). I then want to display this PDF in the inAppBrowser which I normally open with window.open('http://example.com/the-file.pdf', "_blank", "location=no");. But since I already fetched the data I cannot provide a url, but instead I want to provide the data as binary.

I searched around but I only found this SO answer, which unfortunately doesn't work for me.

Does anybody know how I can pass a PDF as binary data through window.open()? All tips are welcome!

Community
  • 1
  • 1
kramer65
  • 45,059
  • 106
  • 285
  • 459

1 Answers1

0

Try this

Window.open('http://docs.google.com/gview?url=YOUR_PDF_URL', "_blank", "location=no"); 
suraj mahajan
  • 804
  • 1
  • 10
  • 20