Skip to main content
Participant
February 16, 2021
Question

File Preview Error; Demo works but not the new PDF URL

  • February 16, 2021
  • 3 replies
  • 484 views
/* Control the default view mode */
const viewerConfig = {
    /* Allowed possible values are "FIT_PAGE", "FIT_WIDTH" or "" */
    defaultViewMode: "",
};

/* Wait for Adobe Document Services PDF Embed API to be ready */
document.addEventListener("adobe_dc_view_sdk.ready"function () {
    /* Initialize the AdobeDC View object */
    var adobeDCView = new AdobeDC.View({
        /* Pass your registered client id */
        clientId: "<YOUR_CLIENT_ID>",
        /* Pass the div id in which PDF should be rendered */
        divId: "adobe-dc-view",
    });

    /* Invoke the file preview API on Adobe DC View object */
    adobeDCView.previewFile({
        /* Pass information on how to access the file */
        content: {
            /* Location of file where it is hosted */
            location: {
            },
        },
        /* Pass meta data of file */
        metaData: {
            /* file name */
            fileName: "BSW Proposal -- Danny Testing - Flat Roof Tilt Rack - 01-15-2020 03_23 PM.pdf"
        }
    }, viewerConfig);
});
    This topic has been closed for replies.

    3 replies

    Legend
    February 17, 2021

    Solving this is outside my expertise, but to help you get good answers I suggest you share the actual messages you get. They will be full of important detail. (Redact any personal info tho'!) 

    Danny5E92Author
    Participant
    February 17, 2021

    I appreciated your time and comments. 

     

     

    Legend
    February 17, 2021

    What IS the issue? "Not working" covers a lot of possibilities.

    Danny5E92Author
    Participant
    February 17, 2021

    Sorry, somehow I thought the title tells eough informaiton about the issue. 
    The demo displays "File Preview Error" with the PDF URL attached above. I see a warning message related to CORS. Not sure how I could fix this. 

    Danny5E92Author
    Participant
    February 16, 2021

    Anyone can help me to resolve the issue?