使用office js将word文档转换为PDF时如何创建/启用书签

时间:2018-06-15 07:51:12

标签: ms-word office-js javascript-api-for-office

我使用getFileAsync()方法创建word文档的pdf:

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);
    }

} );

有关详情:https://dev.office.com/reference/add-ins/shared/document.getfileasync

但是一旦创建了pdf,它就不会显示书签。 (当我们通过它的选项设置将单词转换为pdf时,需要像ms中的单词一样启用它) enter image description here

我们是否有办法在办公室js方法中为pdf启用word文档的书签?

0 个答案:

没有答案