Skip to main content
Participant
March 5, 2022
Question

PDF Lightbox doesn't load anything.

  • March 5, 2022
  • 1 reply
  • 413 views

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) 

This topic has been closed for replies.

1 reply

Joel Geraci
Community Expert
Community Expert
March 8, 2022

Based on the code you provided...

previewFile()

...is never getting called.