Some test text!

menu
CORS supportkeyboard_arrow_down

CORS support

If the documents that you want to load are on a different domain than your WebViewer files you'll need to enable CORS on your document server. This site contains more information about how to enable CORS on your server.

Here is an example configuration that works for Amazon S3:

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <AllowedMethod>HEAD</AllowedMethod>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>

If you're using Google Cloud Storage you can refer to Google's documentation on how to set up CORS on a bucket https://cloud.google.com/storage/docs/cross-origin. They describe a few different ways you can upload the CORS configuration to Cloud Storage.

The cors-json-file.json that you can use is:

[
    {
      "origin": ["*"],
      "responseHeader": ["*"],
      "method": ["*"],
      "maxAgeSeconds": 3600
    }
]
If you need to support IE9 and your documents are on another domain then you'll need to use the XDomain library.

Get the answers you need: Support

close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.

Join our live demo to learn about use cases & capabilities for WebViewer

Learn more
close