Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Javascripti functions accepting Flask parameters to display a PDF file with Adobe Embed API

function previewFile(urldata) {

    var myURL = urldata[0];
    var myFileName = urldata[1];

    if(window.AdobeDC) displayPDF(myURL, myFileName);
    else document.addEventListener("adobe_dc_view_sdk.ready", 
        () => displayPDF(myURL, myFileName));
}

function displayPDF(myURL, myFileName) {

    document.write('displayPDF');
    const viewerConfig = {
        embedMode: "FULL_WINDOW",
        defaultViewMode: "FIT_PAGE",    
        showLeftHandPanel: true,
        showAnnotationTools: true,
        showDownloadPDF: true,
        showPrintPDF: true,
        showPageControls: true,
        showDisabledSaveButton: true,
        downloadWithCredentials: true
    };

    var adobeDCView = new AdobeDC.View({
        clientId: '<CLIENT_ID_KEY_HERE',
        divId: "adobe-dc-view"
    });

    adobeDCView.previewFile({
        content: {
            location: {
                url: myURL,
            },
        },
        metaData: {
            fileName: myFileName
        }
    }, viewerConfig);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: adding transition to collapse button js 
Javascript :: Alternate capitalization 
Javascript :: find minimum 
Javascript :: phaser place on line 
Javascript :: phaser rotate around x y point 
Javascript :: phaser animation get progress 
Javascript :: phaser multi atlas animation 
Javascript :: phaser sprite animation event 
Javascript :: .every() Accepts a test function and returns a boolean if all the elements of the array pass the test. 
Javascript :: data tables ajust columns after init 
Javascript :: Opposites attract 
Javascript :: angular reactive forms bootstrap 4 
Javascript :: filter text js 
Javascript :: why cant i add to object mongoose 
Javascript :: cargar un select con javascript dependiendo de otro select 
Javascript :: javascript setinterval run immediately 
Javascript :: javascript static methods 
Javascript :: select and select based on value in jquery 
Javascript :: how to do a function after a set interval js 
Javascript :: react-scripts not found 
Javascript :: mongoose remove 
Javascript :: underscore.js 
Javascript :: change css variable with javascript 
Javascript :: spread operator es6 
Javascript :: date range picker jquery 
Javascript :: how to use break in javascript 
Javascript :: javascript fadeout without jquery 
Javascript :: javscript async function 
Javascript :: Using the Set object 
Javascript :: react fontawesome exchange icon 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =