pdf wiever issue in firefox

Hello , we are trying to implement the pdf viewer but we noticed a problem with firefox .
Firefox does not display the preview PDF .
Firefox is updated to version 46.0
While webix is updated to version 3.1.2 .
I see this problem even in the demo on the website

http://docs.webix.com/samples/60_pro/10_viewers/01_pdf.html

Thanks for your help!

Hello,

I can confirm the issue. Thanks for pointing it out!

Meanwhile, if issue is critical for your app, you can disable usage of webix.cdn and use local js files, it will solve the issue in FF.

Hi all.

I tried to check the most browsers on windows and on Mac and everything work good so fare. :slight_smile:

Except Firefox (last stable) on Mac with the pdf viewer I get this message:

SecurityError: Failed to load worker script at “//cdn.webix.com/extras/pdfjs/pdf.worker.min.js

But Firefox on windows works on viewing pdfs…

It would be better to have ALL files local on server instade loading from cdn.webix.com or something.
Please give me a short list how to do this.

Thank you

Michael

Edit: I’ve checked it for myself. And works now also on Firefox on OS 10. :slight_smile:

So please don’t mind :wink:

Please give me a short list how to do this.

Grab files from github and store them locally

Set path in js code as

webix.cdn = "/some/foder/";

I work with webix framework under cakephp 3 so

The path should be “//hostname/some/folder” In this way it works.
If I take your advise it will not be found

The path must be a relative or absolute path to the local folder. The exact path value depends on a routing approach of your app. As far as a path is a valid HTTP path to the CDN folder, it will work.

Hi,

I’ve downloaded the CDN files from github and in my webix.ready function I’ve set the webix.cdn location to be webix.cdn = “./ext/cdn-extras-master”;

However I get an error stating "“NetworkError: 404 Not Found - http://…/Webix/codebase/ext/cdn-extras-master/extras/pdfjs/compatibility.min.js”

If I ALSO copy the cdn files under …/Webix/codebase/ext/cdn-extras-masters then the PDF viewer works.

Why does it need to be in two places? Have I missed something?

Cheers

Andy

Hi @NZAndy,

There’s no need to put the resources into the Webix codebase. As Maksim said,

The path must be a relative or absolute path to the local folder.

But considering the peculiarity of the requests organization, the relative path must be built regarding the current page, i.e.

webix.cdn = "../../../../webix-cdn";
// or an absolute path:
webix.cdn = "http://localhost/webix-cdn"

I’ll coming back with this problem on firefox V71 :slight_smile:
And I’m still with webix version 6.10
I changed webix.cdn to absolute path but webix still load from cdn.webix.com and pdf’s will not be shown and pdf.worker.min.js has no response ;-(

My code is:
// pdfObject is pdfviewer object

window.loadPdf = function(obj, model, pdfObject){
‘use strict’;
console.log(webix.cdn);
webix.ajax().response(‘arraybuffer’).post(’/documents/loadPdf’,{obj:obj, model:model},function(){
}).then(function(data){
//console.log(data);

    pdfObject.parse({data:data});
    pdfObject.setMasterScale(1);
});
return pdfObject;

};

Works on IE and Chrome even on Safari (both on Windows and Mac)… !

Please for help to figure this out.

Thank you

Michael

I’ve got it, after I wrote to you:

It should be webix.env.cdn and not webix.cdn!
At least on Webix Version 6.10 :-).

So Christmas may come …
And happy Christmas for you and keep going on this great work!

Michael