Sliverlight error In IE 9

72 views
Skip to first unread message

Wilbur

unread,
Sep 12, 2014, 7:12:39 AM9/12/14
to pdfnet-w...@googlegroups.com
Hi,

I use WebViewer of version 1.8.0 in my project and I also use xdomain.js to implement CORS. When I open my webpage in IE 9, everything looks good, but I got an sliverlight error:

Except this error, I can't find any problem. And I have no idea how to solve this problem. Could you help me?

Matt Parizeau

unread,
Sep 12, 2014, 5:17:43 PM9/12/14
to pdfnet-w...@googlegroups.com
Hi Wilbur,

WebViewer includes a Silverlight based fallback for CORS that works with IE9 and it look like it's mistakenly falling back to that even when xdomain is enabled. I've attached updated WebViewer.js and WebViewer.min.js files that you can use to fix this issue. Just replace your existing copies of these files.

Matt Parizeau
Software Developer
PDFTron Systems Inc.
WebViewer.js
WebViewer.min.js

Wilbur

unread,
Sep 14, 2014, 11:20:21 PM9/14/14
to pdfnet-w...@googlegroups.com
Hi Matt,

I replaced WebViewer.js  and WebViewer.min.js in my project with attached files, but it doesn't works good. The WebViewer doesn't load document and I only see the toolbar in my web page. And I found that the IE browser did not send any request to get  document. And I got an error "SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
" in IE browser (this error is existing since I have used xdomain.js). Could you help me with these issue?

Thanks,
Wilbur

Matt Parizeau

unread,
Sep 15, 2014, 2:22:04 PM9/15/14
to pdfnet-w...@googlegroups.com
Hi Wilbur,

It looks like there was still a case where WebViewer.js wasn't doing the right thing. I've updated and attached the files here again, so let me know if this one works.

Matt Parizeau
Software Developer
PDFTron Systems Inc.
WebViewer.js
WebViewer.min.js

Wilbur

unread,
Sep 16, 2014, 3:25:17 AM9/16/14
to pdfnet-w...@googlegroups.com
Hi Matt,

I tried replace attachment files again,but I got the same result. I look into WebViewer.js you gave and I found that you update something in method _createHTML5, I feel confused that  you update method _createHTML5  rather than __createSilverlight and I think method _createSilverlight is used to create WebViewer with Silverlight.

Thanks,
Wilbur

Matt Parizeau

unread,
Sep 16, 2014, 1:29:23 PM9/16/14
to pdfnet-w...@googlegroups.com
Hi Wilbur,

Maybe we're not talking about quite the same thing. When you said that you were handling CORS with xdomain.js in IE9 and it was giving that error I was assuming you were using the HTML5 viewer (since xdomain.js only applies to the HTML5 viewer). Are you actually trying to use the Silverlight viewer on IE9? If you want to support CORS with Silverlight you just need to place the file clientaccesspolicy.xml (can be found in the WebViewer download package) inside the root folder of your web server.

If you want to use the HTML5 viewer with IE9 and CORS then I believe my changes should work. I went through the xdomain.js tutorial (https://www.pdftron.com/webviewer/demo/tutorials/02.html) and made sure to substitute the new WebViewer.min.js file (attached here). Also make sure to clear your browser cache so that you know you're using the updated files. If you are using the HTML5 viewer with xdomain.js then nothing with Silverlight should be involved.

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Wilbur

unread,
Sep 17, 2014, 6:35:56 AM9/17/14
to pdfnet-w...@googlegroups.com
Hi Matt,

Sorry, it's my fault. When I got the silverlight error I think WebViewer use silverlight to display document in IE 9. I want to use HTML5 viewer in IE 9. Now I don't get that error any more, but there is still an issue that it can't load document from http://pdftron.s3.amazonaws.com/files/xod/NY_fun_list.xod .There is hasn't this issue in IE 8 and IE 10. By the way, I post a post earlier today and I figure out it now, you can ignore it. I am sorry about this.

Regards,
Wilbur

Matt Parizeau

unread,
Sep 17, 2014, 12:54:29 PM9/17/14
to pdfnet-w...@googlegroups.com
Hi Wilbur,

For that file the server sets the headers for CORS so this will work in the HTML5 viewer for browsers that support CORS. IE9 unfortunately doesn't support CORS and so it can't view that file. Since you don't have access to that server you aren't able to put a proxy.html and xdomain.js file like you could for your own server to make it work with IE9. If you're using your own server to host files then you can set the proxy.html file like you've been doing.

The reason it works with IE8 is because that will fall back to using the Silverlight viewer and the clientaccesspolicy.xml file will be used to allow it to access that file. There is also another workaround if you have IE9 with Silverlight enabled. WebViewer can display the document in the HTML5 viewer and at the same time use Silverlight to request the part data and use the clientaccesspolicy file. So if you have IE9 with Silverlight enabled then it should work. However as long as you're loading documents on your own server you should be fine with xdomain.js.

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Wilbur

unread,
Sep 18, 2014, 7:09:35 AM9/18/14
to pdfnet-w...@googlegroups.com
Hi Matt,

You are right!Currently, WebViewer works good in my project except in IE 8 because it uses silverlight and I am making some update for IE 8. Thanks for your help!

I downloaded "WebViewerSilverlightSDK"  and trying to custom the WebViewer and I get into trouble:
  1. Can we filter annotations by author like method FilterAnnotations in HTML5 API?It seems no a method do similar things in Silverlight SDK.
  2. In WebViewer.js, there is a  silverlightObjectParams option to create WebViewer, but I don't understand how to use it. Do we can use it like custom option?And can we get custom option when we use Silverlight. I want to replace annotations author id with author name before load annotaions and  replace annotations author name with author id before send request to save annotations.Any suggest?
  3. In silverlight, can we get modified annotations like method GetAnnotCommand do? I know there is a method GetAllChangedAnnotations  can get modified annotations!
Thanks,
Wilbur



Regards,
Wilbur
Reply all
Reply to author
Forward
0 new messages