Skip to main content
Participating Frequently
Oct 29, 2020 4:58 PM UTC
Question

Gerring File preview Error

Getting the error "File preview Error" File preview not available, please reload to try again.

    This topic is closed to new replies. Start a new post to keep the conversation going.

    7 replies

    Joel Geraci
    Community Expert
    Community Expert
    Oct 29, 2020 5:19 PM UTC

    Can you share your code? The dialog doesn't provide enough information to diagnose the issue.

    Translate
    Participating Frequently
    Oct 29, 2020 5:23 PM UTC

    Hi find the below code. This was working fine some days back, There is no change since it was working.

    $.getScript("https://documentcloud.adobe.com/view-sdk/main.js", function () {
    var viewerConfig = {
    showAnnotationTools: false,
    enableFormFilling: false,
    showLeftHandPanel: true,
    showDownloadPDF: true,
    showPrintPDF: true,
    showPageControls: true,
    dockPageControls: true,
    defaultViewMode: "", /* Allowed possible values are "FIT_PAGE", "FIT_WIDTH" or "". */
    };

    var ids = {
    "st-prev-www.gepower.com": "61d3e4e8c8414c18ab503e069393145b",
    "st-gaspower.portal.ge.com": "fabf91fe9c9343bb92f9b12ce4dc0cdc",
    "prev-www.gepower.com": "372b3ea823ba48ad9f15518d428b9a38",
    "gaspower.portal.ge.com": "815531dec4ea49839d7d45e5b8b7e3c4"
    };

    /* Wait for Adobe Document Cloud View SDK 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: ids[location.hostname],
    /* Pass the div id in which PDF should be rendered */
    divId: "pdf_modal",
    });

    /* 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: {
    url: $('.pdf_btn').data('pdfpath'),
    },
    },
    /* Pass meta data of file */
    metaData: {
    /* file name */
    fileName: $('.pdf_name').data('pdfname')
    }
    }, viewerConfig);
    });
    });

    Translate
    Joel Geraci
    Community Expert
    Community Expert
    Oct 29, 2020 5:31 PM UTC

    Ok - What's the URL to the PDF?

    Translate