PDF Embed API Script Parsing Errors with WordPress & main.js 404 with active WP-Rocket Cache Plugin

New Here ,
Oct 07, 2021 Oct 07, 2021

Copy link to clipboard

Copied

Hey there, 

I have embedded my PDF with the PDF API Script into my wordpress Website and I have the WP-Rocket Cache Plugin. I am facing two major some issues that I need to have solved.

 

At first, I have the API Embed Script integrated like this in the body of the website:

<div id="adobe-dc-view" style="width: 100%;"></div>
<script src="https://documentcloud.adobe.com/view-sdk/main.js"></script>
<script type="text/javascript">
document.addEventListener("adobe_dc_view_sdk.ready", function(){
var adobeDCView = new AdobeDC.View({clientId: "6b0c4686e1b842909660a955344f3322", divId: "adobe-dc-view"});
adobeDCView.previewFile({
content:{location: {url: "https://my-ul/wp-content/uploads/YYYY/MM/my-ebook.pdf"}},
metaData:{fileName: "my-ebook.pdf"}
}, {embedMode: "IN_LINE", showDownloadPDF: false, showPrintPDF: false});
});
</script>

 

So I have the following issues here:

1. The PDF I am embedding won't display, when the WP-Rocket Cache Plugin is activated. I get a 404 error calling the script in the body of the DOM, together with the code that is provided by the PDF API Embed solution:

2021-10-07 (2).png

 

2. When the WP-Rocket Cache Plugin is deactivated, I see the PDF, BUT I get a bunch of parsing violation and error messages:
2021-10-07.png
I need the Cache Plugin to improve the page speed. What should I do?

Thanks for your fast support and your time upfront.

 

TOPICS
PDF Embed API

Views

50

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources