• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

PDF Lightbox doesn't load anything.

New Here ,
Mar 04, 2022 Mar 04, 2022

Copy link to clipboard

Copied

Hi, I am only a few hours into this, but I am attempting to use the lightbox embed. 

I have used the github sample code to get started -- it seems to trigger the API correctly in that the spinning loader appears, but nothing after that... it just disappears. 

Here is my code 

<script src="https://documentcloud.adobe.com/view-sdk/main.js"></script>

<script type="text/javascript">

const viewerConfig = {
    embedMode: "LIGHT_BOX",
    showPageControls: false, 
    showDownloadPDF: false, 
	showPrintPDF: false
};

document.addEventListener("adobe_dc_view_sdk.ready", function () {
    document.getElementById("readbook").disabled = false;
});

function previewFile()
{
    var adobeDCView = new AdobeDC.View({
        clientId: "<put my ID>"
    });

    adobeDCView.previewFile({
        content: {
            location: {
                url: "https://mihikashilpi.com/wp-content/uploads/2021/06/A-Pixelated-Plumber-Book.pdf",
            },
        },
        metaData: {
            fileName: "A-Pixelated-Plumber-Book.pdf"
        }
    }, viewerConfig);
};

</script>

The console shows no errors so I cannot figure out where I am wrong... (the PDF URL opens on any browser and is on the same domain as the embed I am trying to create) 

TOPICS
PDF Embed API

Views

193

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
Community Expert ,
Mar 08, 2022 Mar 08, 2022

Copy link to clipboard

Copied

LATEST

Based on the code you provided...

previewFile()

...is never getting called.

Votes

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
Resources