2

I used getFileAsync() method to create pdf of the word document:

Office.context.document.getFileAsync(Office.FileType.Pdf,
function(result) {
    if (result.status == "succeeded") {
        var myFile = result.value;
        var sliceCount = myFile.sliceCount;
        app.showNotification("File size:" + myFile.size + " #Slices: " + sliceCount);
        // Now, you can call getSliceAsync to download the files, as described in the previous code segment (compressed format).

        myFile.closeAsync();
    }
    else {
        app.showNotification("Error:", result.error.message);
    }

} );

For more details: https://dev.office.com/reference/add-ins/shared/document.getfileasync

But once the pdf gets created, it doesn't show up the bookmarks. (Need to enable it like we can in ms word when we convert word to pdf through it's options setting) enter image description here

Do we have any way in office js methods for enabling bookmarks of word document for pdf ?

0 Answers0