Siebel Business Process & Functionality (MOSC)

MOSC Banner

base64 to Binary (PDF)

edited May 9, 2019 2:45AM in Siebel Business Process & Functionality (MOSC) 4 commentsAnswered

Hi Team,

We are trying to convert the base64 string which we get from external system to Binary and display in PDF format in IE. Below is the sample code I tried in Browser script on click of a button.

 

             if(name == "GenerateContract")

              {

var data = "JVBERi0xLjYKJfbk/N8KMSAwIG9iago8PAovVHlwZSAvQ2F0YWxvZwovUGFnZXMgMiAwIFIKL0F";

var fileName = "Testing";

//if (window.navigator && window.navigator.msSaveOrOpenBlob)

  //{ // IE workaround

  //theApplication().SWEAlert(data);

    var byteCharacters = atob(data);

// var byteCharacters = window.atob(data);

    theApplication().SWEAlert(data);

    var byteNumbers = new Array(byteCharacters.length);

    for (var i = 0; i < byteCharacters.length; i++)

    {

        byteNumbers[i] = byteCharacters.charCodeAt(i);

    }

    var byteArray = new Uint8Array(byteNumbers);

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center