cancel
Showing results for 
Search instead for 
Did you mean: 

iframe pdf viewer problem at IE browser

onur_sara
Participant
0 Kudos

Hi All ,

I am getting PDF data from backend system and showing it in iframe pdf viewer  with codes below . This solution works well at Chrome or Firefox .


var srcURL = "data:application/pdf;base64," +data;

          oHTML.setContent( "<iframe src='"+srcURL+"'  frameborder='0' style='position: absolute; height:100%; border: none' height='100%' width='100%''></iframe>");

But if I run the application at IE browser , it is showing an empty frame .

If you have any idea about it , please let me know .

Thanks .

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member667623
Discoverer
0 Kudos

Hello

Did you find a solution to the pdfviewer problem with ie11? If you solve it i will glad of you be able to share your solution....

maartenf
Participant
0 Kudos

Hi Onur,

When reviewing the browser developer tools in IE, do you see if the PDF data is loaded correctly?

in you gateway implementation, did you add the HTTP response header content-disposition?

data: ls_header type ihttpnvp.

ls_header-name = 'content-disposition'.

ls_header-value = 'inline;filename=file.pdf'.

set_header( ls_header ).

Best regards,

Maarten



onur_sara
Participant
0 Kudos

Hi ,

PDF data is loading correctly . But  I didn't add  content dispotion on my response  header .

I found something that  " Internet Explorer does not support the use of DATA URIs as the source of IFRAMEs "

at below website .

internet explorer - Workaround of showing a base64 pdf on IE9+ - Stack Overflow

So I need to give a pdf url into iframe tag .

Does Content dispotion solve my problem ? and Can you give me an example how I can  use it in my JS code at Client side   ?


Thanks .

maartenf
Participant
0 Kudos

Hi Onur,

Hmm, I wasn't aware of that... Like the link states, it could be a good workaround to open the URL to get the pdf in a new tab/window.

window.open("https://server_hostname/path/to/gw/service/pdfEntity/$value")

As I said, I'm not sure the content-disposition will solve the issue you are currently having (I suppose not when reading the link you have provided). Anyway, the content-disposition http header does not have to be handled by the UI. Basically you are telling the browser to show the pdf inline (and not as a download). This is handled automatically by the browser.

Good luck!

Best regards,

Maarten

onur_sara
Participant
0 Kudos

Thanks.