Skip to main content
Participant
August 18, 2022
Question

PDF Embed API Got error

  • August 18, 2022
  • 1 reply
  • 1240 views

Hello comunity i am just create a PDF Embed API for embeded api but when i try to run the code come a error which is : File preview error > File preview not available, please reload to try again.  I Try all posible ways But Not work .

Resister Domain With : cdnlottery.s3.eu-central-003.backblazeb2.com

 

Please suggest me how to fix it

 

Code is 

<!--Get the samples from https://www.adobe.com/go/pdfembedapi_samples-->
<!DOCTYPE html>
<html>
<head>
 <title>Adobe Document Services PDF Embed API Sample</title>
 <meta charset="utf-8"/>
 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
 <meta id="viewport" name="viewport" content="width=device-width, initial-scale=1"/>
</head>
<body style="margin: 0px">
 <div id="adobe-dc-view"></div>
 <script src="https://documentcloud.adobe.com/view-sdk/viewer.js"></script>
 <script type="text/javascript">
    document.addEventListener("adobe_dc_view_sdk.ready", function()
    {
        var adobeDCView = new AdobeDC.View({clientId: "myClientID", divId: "adobe-dc-view"});
        adobeDCView.previewFile(
       {
          content:   {location: {url: "https://cdnlottery.s3.eu-central-003.backblazeb2.com/pdf/MN180822.pdf"}},
          metaData: {fileName: "MN160822.PDF"}
       });
    });
 </script>
</body>
</html>
This topic has been closed for replies.

1 reply

Raymond Camden
Community Manager
Community Manager
August 18, 2022

I tried your PDF in our online demo and it worked fine there. Do you see any error messages in your browser console? Is this avaiable online where I can see?

Mr.BaponAuthor
Participant
August 18, 2022

But Unfortunetly not work for me please cheack at : https://provider.mlmhut.com/pdftest/next.html

Raymond Camden
Community Manager
Community Manager
August 18, 2022

It's a CORS issue. You can see it in the browser console:

 

Access to XMLHttpRequest at 'https://cdnlottery.s3.eu-central-003.backblazeb2.com/pdf/MN180822.pdf' from origin 'https://provider.mlmhut.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

 

The server that hosts the PDF file needs to allow for remote loading of the resource.