LoadFromURL in TMSFNCWXPDFViewer1 doesn't work

Test browser android.zip (83.4 KB)

Hi guys, I'm trying to load this URL https://www.orimi.com/pdf-test.pdf in TMSFNCWXPDFViewer, but the LoadFromURL procedure doesn't work, the PDF isn't displayed. I've attached a test project.

Best regards.

Hi,

Looks like a CORS issue, so the pdf.js library cannot load it.

Sometimes a workaround is to use an XMLHTTPRequest to get the binary first and feed that to pdf.js, but even that is blocked by CORS. If you are in control of this server, you'll need to look at that.

Hi Tunde, can you give me a URL to a PDF to test? I've tested it on different servers and the behavior is the same. When I invoke the URL from a browser, it displays it without any problems.

Best regards

Hi,

This is an example pdf that we can load here: https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/examples/learning/helloworld.pdf

Invoking the url directly is different than making a request via JavaScript for the resource.