Skip to main content
Level 2
July 6, 2017
Resuelto

Use pdf.js: Cross domain access error

  • July 6, 2017
  • 1 respuesta
  • 3456 visualizaciones

I like to insert a pdf in a HTML article with the help of pdf.js.

It works perfectly in the aem preflight app, but not in our own developper test app.

In our app there is the following error:

XMLHttpRequest cannot load file:///var/mobile/Containers/Data/..../test.pdf. Cross origin requests are only supported for HTTP.

So is it possible to set <access origin="*" /> or somithing like this on our own app, so it can load local files?

Or what is the difference from our own app to the preflight app?

Thanks, David

Este tema ha sido cerrado para respuestas.
Mejor respuesta de brucelef

Hi David,

I've seen this library work in other applications so I believe that this is due to a known issue [1] with using the WKWebViewEngine in iOS.

Can you try creating a new app with the WKWebView plugin disabled?

[1] [CB-10143] Local file:// url XmlHttpRequests are not allowed in WKWebViewEngine - ASF JIRA

1 respuesta

brucelefAdobe EmployeeRespuesta
Adobe Employee
July 14, 2017

Hi David,

I've seen this library work in other applications so I believe that this is due to a known issue [1] with using the WKWebViewEngine in iOS.

Can you try creating a new app with the WKWebView plugin disabled?

[1] [CB-10143] Local file:// url XmlHttpRequests are not allowed in WKWebViewEngine - ASF JIRA