Many users have been asking for a way to pull pdf files from Amazon S3, So, We did a workaround and identified a way to display PDF Files from Amazon S3 using PDF viewer for WordPress Plugin.
PDF viewer for WordPress can’t pull pdf files from Third-party domains due to cross-domain policy. But you can pull pdf from third-party sites as well, just need to have CORS enabled on the source server. Have a look at the following link for more information about CORS enable-cors.org
By the way, Amazon s3 provides an option to add/edit CORS configuration for each bucket. In this article, I’ll show you the way how you can update CORS setting on Amazon s3 to make your PDF files accessible by PDF viewer for WordPress.
1. Login to your s3 management console
2. Enter the bucket you want to change the setting of
3. Click on Permission and scroll to the Cross-origin resource sharing (CORS) section
4. Click on the Edit button in that section
5. Put the following codes in the popup editor that will appear after clicking on Edit CORS Configuration:
6. Click on Save
7. Upload a pdf file inside the bucket.
8. Make sure to change the permission of the uploaded file to be accessible by everyone
9. Now Copy the pdf file URL and go back to your website’s post/page editor. Put the URL in any of the tnc-pdf-viewer shortcodes, and the pdf should appear inside the viewer!
This is the easiest way to Display PDF Files from Amazon S3. Please feel free to use our support portal if you have any questions or need support for any issues.
Thank You
0 Comments