Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Use pdf.js: Cross domain access error

Avatar

Avatar
Validate 1
Level 1
davidm87596861
Level 1

Like

1 like

Total Posts

8 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
davidm87596861
Level 1

Like

1 like

Total Posts

8 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
davidm87596861
Level 1

06-07-2017

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back
Employee
Bruce_Lefebvre
Employee

Likes

28 likes

Total Posts

62 posts

Correct Reply

28 solutions
Top badges earned
Give Back
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Give Back
Employee
Bruce_Lefebvre
Employee

Likes

28 likes

Total Posts

62 posts

Correct Reply

28 solutions
Top badges earned
Give Back
Boost 5
Boost 3
Boost 25
Boost 10
View profile
Bruce_Lefebvre
Employee

14-07-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

Answers (0)