-1

iframe src="https://127.0.0.1/test/helloworld.pdf" height="100%" width="100%"></iframe>

I'm working on a Web Application (jsp) project where it will display the pdf content using Iframe on the web page. However, the file is situated on other remote server/file server. Is there a way for me to retrieve a file from other server and display on my Web Application via iframe?

helloworld
  • 1
  • 1
  • 3

2 Answers2

0

Doubt it. Opening PDF in your browser - is your browser settings. If my browser can't open PDF in browser - i can't see it.

Look this question on StackOverflow

Community
  • 1
  • 1
VBeregovoy
  • 29
  • 7
0

I just found the solution on this, we can write a java to read the PDF file from remote server and encode it to base64 string. Then, display it on the iframe src.

<iframe src="data:application/pdf;charset=utf-8;base64,-basepdfstringOutput-></iframe>
helloworld
  • 1
  • 1
  • 3