作成日: 2021/04/28 最終更新日: 2021/04/28
文書種別
使用方法
詳細
addItemメソッドを使用してPDFビューワのツールバーに独自のボタンを追加することができます。
var toolbar = viewer.toolbar;
var toolbarLayout = viewer.toolbarLayout;
toolbar.addItem({
key: "custom",
icon: {
type: "svg",
content: '<svg width="24" height="24" ><circle cx="12" cy="12" r="10" fill="#205F78"/></svg>',
},
title: "custom",
checked: false,
enabled: false,
action: function () {
alert("custom");
},
onUpdate: function (args) {
return {
enabled: viewer.hasDocument,
checked: false,
};
},
});
toolbarLayout.viewer.default.push("custom");
viewer.applyToolbarLayout();