0

I have uploaded a PDF on server by servlet , get that file on client side. Now I want to set the file to the src of Iframe. I have seen the examples but they are setting the src like src='http://www.tutorialspoint.com/java/java_tutorial.pdf?file=http://www.tutorialspoint.com/java/java_tutorial.pdf but I have the file with name like "file12314232343244" I am setting the src like this

HTML pdf = new HTML("<iframe position='absolute'src='http://www.tutorialspoint.com/java/java_tutorial.pdf?file=http://www.tutorialspoint.com/java/java_tutorial.pdf'  />");

what should I do for that ?

Dinesh Pathak DK
  • 185
  • 1
  • 3
  • 15

1 Answers1

0

Use the type parameter:

type="application/pdf"

as shown https://stackoverflow.com/a/42908837/2979092

WLGfx
  • 1,169
  • 15
  • 31