Using files from external sources requires CORS config. Please have a look at the following article that explains how to set up CORS config on amazon s3 bucket: https://themencode.com/display-pdf-files-from-amazon-s3-using-pdf-viewer-for-wordpress/
You can take some idea from the article above and implement CORS on the website where you're trying to use the PDF's from.