powerpoint package

Functions

PowerPoint.createPresentation(base64File)

Creates and opens a new presentation. Optionally, the presentation can be pre-populated with a base64-encoded .pptx file.

[ API set: PowerPointApi 1.1 ]

Function Details

PowerPoint.createPresentation(base64File)

Creates and opens a new presentation. Optionally, the presentation can be pre-populated with a base64-encoded .pptx file.

[ API set: PowerPointApi 1.1 ]

export function createPresentation(base64File?: string): Promise<void>;

Parameters

base64File
string

Optional. The base64-encoded .pptx file. The default value is null.

Returns

Promise<void>

Examples

var myFile = document.getElementById("file");
var reader = new FileReader();

reader.onload = function (event) {
    // strip off the metadata before the base64-encoded string
    var startIndex = event.target.result.indexOf("base64,");
    var copyBase64 = event.target.result.substr(startIndex + 7);

    PowerPoint.createPresentation(copyBase64);        
};

// read in the file as a data URL so we can parse the base64-encoded string
reader.readAsDataURL(myFile.files[0]);