-1

I want to run the pdfjs in offline mode without a webserver because I want to embed it in my JavaFX application and render it in WebView, so when I open the viewer.html file in the browser it doesn't work correctly and throws such errors as:

Access to image at 'file:///C:/pdfjs_3/web/images/toolbarButton-viewThumbnail.svg' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.

enter image description here

all the resource files are not accessible the same as above so,

How can I resolve such an issue and make it work without a web server?

Mustafa Poya
  • 2,615
  • 5
  • 22
  • 36

1 Answers1

-1

Inline all your resources (with data URLs) as you cannot read other local files.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335