@compdfkit_pdf_sdk/webviewer 2.8.3 → 2.9.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/CustomModal.532fffc2.css +1 -0
- package/dist/assets/CustomModal.ad195af5.js +1 -0
- package/dist/assets/RightPanelPageMode.16c777c6.css +1 -0
- package/dist/assets/RightPanelPageMode.a65d5ade.js +1 -0
- package/dist/assets/StampPanel.02852fd6.js +1 -0
- package/dist/assets/StampPanel.b042b07b.css +1 -0
- package/dist/assets/{browser-ponyfill.b4df6b68.js → browser-ponyfill.c037802e.js} +1 -1
- package/dist/assets/index.7b78a633.js +2716 -0
- package/dist/assets/index.ba0177ff.css +1 -0
- package/dist/example/Quick Start Guide for ComPDFKit Web Demo.pdf +0 -0
- package/dist/index.html +3 -4
- package/dist/lib/ComPDFKit.js +1 -1
- package/dist/lib/ComPDFKit.wasm +0 -0
- package/dist/lib/PDFWorker.js +1 -1
- package/dist/locales/translation-en.json +35 -11
- package/dist/locales/translation-fr.json +35 -10
- package/dist/locales/translation-ja.json +35 -10
- package/dist/locales/translation-th.json +35 -10
- package/dist/locales/translation-zh-CN.json +35 -10
- package/dist/locales/translation-zh-TW.json +35 -10
- package/package.json +1 -1
- package/webviewer.global.js +1 -1
- package/webviewer.js +1 -1
- package/dist/assets/index.4a4a7d76.js +0 -2698
- package/dist/assets/index.e25a79e0.css +0 -1
- package/dist/example/developer_guide_web.pdf +0 -0
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"uiElements": {
|
|
24
24
|
"color": "顏色",
|
|
25
25
|
"opacity": "不透明度",
|
|
26
|
-
"font": "字體"
|
|
26
|
+
"font": "字體",
|
|
27
|
+
"size": "大小"
|
|
27
28
|
},
|
|
28
29
|
"fontStyles": {
|
|
29
30
|
"regular": "常規",
|
|
@@ -69,6 +70,7 @@
|
|
|
69
70
|
"underline": "底線",
|
|
70
71
|
"strikeout": "刪除線",
|
|
71
72
|
"squiggly": "波浪線",
|
|
73
|
+
"markup": "標記",
|
|
72
74
|
"ink": "手繪",
|
|
73
75
|
"circle": "圓",
|
|
74
76
|
"arc": "圓弧",
|
|
@@ -82,7 +84,8 @@
|
|
|
82
84
|
"image": "圖片",
|
|
83
85
|
"link": "連結",
|
|
84
86
|
"cloudy": "雲朵",
|
|
85
|
-
"callout": "指示備註"
|
|
87
|
+
"callout": "指示備註",
|
|
88
|
+
"eraser": "橡皮擦"
|
|
86
89
|
},
|
|
87
90
|
"formTools": {
|
|
88
91
|
"textField": "文字域",
|
|
@@ -284,7 +287,8 @@
|
|
|
284
287
|
"dynamic": "動態圖章",
|
|
285
288
|
"custom": "自訂圖章",
|
|
286
289
|
"create": "請建立圖章",
|
|
287
|
-
"createHere": "創建圖章"
|
|
290
|
+
"createHere": "創建圖章",
|
|
291
|
+
"importStamp": "導入圖章"
|
|
288
292
|
},
|
|
289
293
|
"link": {
|
|
290
294
|
"title": "連結到",
|
|
@@ -340,6 +344,16 @@
|
|
|
340
344
|
"fillOpacity": "填滿不透明度",
|
|
341
345
|
"dateTime": "日期和時間",
|
|
342
346
|
"createHere": "在此創建"
|
|
347
|
+
},
|
|
348
|
+
"redaction": {
|
|
349
|
+
"borderColor": "密文標記外觀",
|
|
350
|
+
"fillColor": "密文區域填滿顏色",
|
|
351
|
+
"overlayText": "覆蓋文字"
|
|
352
|
+
},
|
|
353
|
+
"eraser": {
|
|
354
|
+
"eraseMode": "擦除模式",
|
|
355
|
+
"partialErase": "部分擦除",
|
|
356
|
+
"eraseAll": "全部擦除"
|
|
343
357
|
}
|
|
344
358
|
},
|
|
345
359
|
|
|
@@ -356,11 +370,18 @@
|
|
|
356
370
|
"removeFailure": "密碼移除失敗!",
|
|
357
371
|
"setSuccess": "密碼設定成功!下載文件後生效。",
|
|
358
372
|
"setFailure": "密碼設定失敗!",
|
|
359
|
-
"
|
|
373
|
+
"openPwd": "開啟密碼",
|
|
360
374
|
"permissionPwd": "權限密碼",
|
|
361
|
-
"
|
|
362
|
-
"
|
|
363
|
-
"
|
|
375
|
+
"allowsPrinting": "允許列印",
|
|
376
|
+
"allowsCopying": "允許複製",
|
|
377
|
+
"readOnly": "唯讀",
|
|
378
|
+
"allowPageEdit": "允許插入、刪除、旋轉頁面",
|
|
379
|
+
"allowFormFillAndSign": "允許填寫表單、簽署現有的表單欄位",
|
|
380
|
+
"allowAnnotateFillAndSign": "允許註釋、填寫表單、簽署現有的表單欄位",
|
|
381
|
+
"noOpenPwd": "無需密碼即可開啟此文件。",
|
|
382
|
+
"hasOpenPwd": "開啟文件需要此密碼。",
|
|
383
|
+
"noPermissionPwd": "無需密碼即可編輯此文件",
|
|
384
|
+
"hasPermissionPwd": "已設定檔案編輯權限,需要密碼才能進行該項編輯",
|
|
364
385
|
"notes": [
|
|
365
386
|
"注意:",
|
|
366
387
|
"- 所有變更將在下載後生效。",
|
|
@@ -461,7 +482,7 @@
|
|
|
461
482
|
"name": "名稱",
|
|
462
483
|
"distinguishableName": "辨別名",
|
|
463
484
|
"date": "日期",
|
|
464
|
-
"version": "
|
|
485
|
+
"version": "ComPDF 版本",
|
|
465
486
|
"logo": "標誌",
|
|
466
487
|
"location": "位置",
|
|
467
488
|
"reason": "原因",
|
|
@@ -530,7 +551,7 @@
|
|
|
530
551
|
"printSettings": "列印文件選擇",
|
|
531
552
|
"printOld": "列印舊文件的比較結果文件",
|
|
532
553
|
"printNew": "列印新文件的比較結果文件",
|
|
533
|
-
"credit": "由
|
|
554
|
+
"credit": "由ComPDF提供對比"
|
|
534
555
|
},
|
|
535
556
|
|
|
536
557
|
"contentEditor": {
|
|
@@ -562,6 +583,7 @@
|
|
|
562
583
|
"documentEditor": {
|
|
563
584
|
"saveAs": "另存為",
|
|
564
585
|
"insert": "插入",
|
|
586
|
+
"merge": "合併",
|
|
565
587
|
"rotateRight": "右旋轉",
|
|
566
588
|
"rotateLeft": "左旋轉",
|
|
567
589
|
"copy": "複製",
|
|
@@ -587,7 +609,10 @@
|
|
|
587
609
|
"page": "頁面",
|
|
588
610
|
"tip": "例:3, 5-10",
|
|
589
611
|
"before": "前",
|
|
590
|
-
"after": "後"
|
|
612
|
+
"after": "後",
|
|
613
|
+
"mergePages": "合併頁面",
|
|
614
|
+
"selectFiles": "選擇文件",
|
|
615
|
+
"mergeTip": "例如 1,3;2-4; ;"
|
|
591
616
|
},
|
|
592
617
|
"deleteConfirmation": "確認要刪除所選頁面嗎?",
|
|
593
618
|
"separateFiles": "每頁作為單一文件",
|
package/package.json
CHANGED
package/webviewer.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).ComPDFKitViewer=t()}(this,(function(){"use strict";function e(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function t(t,i){for(var n=0;n<i.length;n++){var o=i[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,e(o.key),o)}}var i={init:function(e,t){return new Promise((function(i){t.addEventListener("ready",(function e(){t.removeEventListener("ready",e);var n=t.querySelector("iframe").contentWindow;try{var o=n.instance;Promise.resolve().then((function(){i(o)}))}catch(e){i()}})),new c(e,t)}))}};var n,o,r,s=0,a=new Map,c=function(){return e=function e(t,i){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!a.get(i)){this.version="2.
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).ComPDFKitViewer=t()}(this,(function(){"use strict";function e(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function t(t,i){for(var n=0;n<i.length;n++){var o=i[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,e(o.key),o)}}var i={init:function(e,t){return new Promise((function(i){t.addEventListener("ready",(function e(){t.removeEventListener("ready",e);var n=t.querySelector("iframe").contentWindow;try{var o=n.instance;Promise.resolve().then((function(){i(o)}))}catch(e){i()}})),new c(e,t)}))}};var n,o,r,s=0,a=new Map,c=function(){return e=function e(t,i){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!a.get(i)){this.version="2.9.0",this.docId=0,a.set(i,!0),this.instance=null,this.options=t,this.initialDoc=t.pdfUrl||null,this.element=i,this.options.path=this.options.path||e.config.path;var n=this.options.path.length-1;n>0&&"/"!==this.options.path[n]&&(this.options.path+="/"),this.options.webviewerPath=this.options.path+e.config.webviewerPath,i.addEventListener("ready",(function e(){i.removeEventListener("ready",e)})),this.create()}},(i=[{key:"_createEvent",value:function(e,t){var i;try{i=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0})}catch(n){(i=document.createEvent("Event")).initEvent(e,!0,!0),i.detail=t}return i}},{key:"create",value:function(){this.initialDoc?(this.initialDoc=encodeURIComponent(JSON.stringify(this.initialDoc)),this._create()):this._create()}},{key:"_create",value:function(){this.docId=++s,this._trigger||(this._trigger=function(e,t){var i=this._createEvent(e,t);this.element.dispatchEvent(i)});var e=this;this.messageHandler=function(t){if("requestConfig"===t.data.type&&t.data.docId===e.docId&&t.source){window.removeEventListener("message",this.messageHandler);var i=e.options.config?e._correctRelativePath(e.options.config):"";t.source.postMessage({type:"responseConfig",value:i,options:e.options},"*")}},window.addEventListener("message",this.messageHandler,!1),this.createViewer()}},{key:"_correctRelativePath",value:function(e){return function(e,t){if("string"!=typeof e||!t)return e;var i=t.substring(0,t.lastIndexOf("/"));return/^(\/|%2F|[a-z0-9-]+:)/i.test(e)?e:"".concat(i,"/").concat(e)}(e,window.location.pathname)}},{key:"createViewer",value:function(){var e,t,i,n=this,o=this.options.webviewerPath+"?version="+this.version;this.initialDoc?o+="#d=".concat(this.initialDoc):o+="#",o+="&docId=".concat(this.docId),(null===(e=this.options)||void 0===e?void 0:e.css)&&(o+="&css=".concat(encodeURIComponent(this.options.css))),void 0!==this.options.showToolbarControl&&(o+="&header=".concat(this.options.showToolbarControl?"true":"false")),this.options.theme&&(o+="&theme=".concat(this.options.theme));var r=document.createElement("iframe");r.id="webviewer-"+this.docId,r.src=o,r.frameBorder=0,r.width="100%",r.height="100%",r.setAttribute("allowfullscreen",!0),r.setAttribute("webkitallowfullscreen",!0),r.setAttribute("mozallowfullscreen",!0),this.iframe=r,null!==(t=this.options)&&void 0!==t&&t.backgroundColor&&r.setAttribute("data-bgcolor",this.options.backgroundColor),null!==(i=this.options)&&void 0!==i&&i.assetPath&&r.setAttribute("data-assetpath",encodeURIComponent(this.options.assetPath)),this.element.appendChild(r),window.addEventListener("message",(function e(t){if("viewerLoaded"===t.data.type&&t.data.docId===n.docId)try{n.instance=n.iframe.contentWindow.instance}catch(e){}finally{window.removeEventListener("message",e),n._viewerLoaded(n.iframe)}}))}},{key:"_documentViewerLoaded",value:function(e){this.options.pdfUrl&&e.contentWindow.instance.UI.loadDocument(this.options.pdfUrl)}},{key:"_viewerLoaded",value:function(e){this._trigger("ready");try{e.contentWindow.postMessage({type:"viewerLoaded",options:this.options},"*")}catch(e){}}}])&&t(e.prototype,i),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,i,n}();return n=c,r={path:"",webviewerPath:"./webviewer/index.html"},(o=e(o="config"))in n?Object.defineProperty(n,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[o]=r,i}));
|
package/webviewer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function t(t,i){for(var n=0;n<i.length;n++){var o=i[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,e(o.key),o)}}var i={init:function(e,t){return new Promise((function(i){t.addEventListener("ready",(function e(){t.removeEventListener("ready",e);var n=t.querySelector("iframe").contentWindow;try{var o=n.instance;Promise.resolve().then((function(){i(o)}))}catch(e){i()}})),new c(e,t)}))}};var n,o,r,a=0,s=new Map,c=function(){return e=function e(t,i){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!s.get(i)){this.version="2.
|
|
1
|
+
function e(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function t(t,i){for(var n=0;n<i.length;n++){var o=i[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,e(o.key),o)}}var i={init:function(e,t){return new Promise((function(i){t.addEventListener("ready",(function e(){t.removeEventListener("ready",e);var n=t.querySelector("iframe").contentWindow;try{var o=n.instance;Promise.resolve().then((function(){i(o)}))}catch(e){i()}})),new c(e,t)}))}};var n,o,r,a=0,s=new Map,c=function(){return e=function e(t,i){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!s.get(i)){this.version="2.9.0",this.docId=0,s.set(i,!0),this.instance=null,this.options=t,this.initialDoc=t.pdfUrl||null,this.element=i,this.options.path=this.options.path||e.config.path;var n=this.options.path.length-1;n>0&&"/"!==this.options.path[n]&&(this.options.path+="/"),this.options.webviewerPath=this.options.path+e.config.webviewerPath,i.addEventListener("ready",(function e(){i.removeEventListener("ready",e)})),this.create()}},(i=[{key:"_createEvent",value:function(e,t){var i;try{i=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0})}catch(n){(i=document.createEvent("Event")).initEvent(e,!0,!0),i.detail=t}return i}},{key:"create",value:function(){this.initialDoc?(this.initialDoc=encodeURIComponent(JSON.stringify(this.initialDoc)),this._create()):this._create()}},{key:"_create",value:function(){this.docId=++a,this._trigger||(this._trigger=function(e,t){var i=this._createEvent(e,t);this.element.dispatchEvent(i)});var e=this;this.messageHandler=function(t){if("requestConfig"===t.data.type&&t.data.docId===e.docId&&t.source){window.removeEventListener("message",this.messageHandler);var i=e.options.config?e._correctRelativePath(e.options.config):"";t.source.postMessage({type:"responseConfig",value:i,options:e.options},"*")}},window.addEventListener("message",this.messageHandler,!1),this.createViewer()}},{key:"_correctRelativePath",value:function(e){return function(e,t){if("string"!=typeof e||!t)return e;var i=t.substring(0,t.lastIndexOf("/"));return/^(\/|%2F|[a-z0-9-]+:)/i.test(e)?e:"".concat(i,"/").concat(e)}(e,window.location.pathname)}},{key:"createViewer",value:function(){var e,t,i,n=this,o=this.options.webviewerPath+"?version="+this.version;this.initialDoc?o+="#d=".concat(this.initialDoc):o+="#",o+="&docId=".concat(this.docId),(null===(e=this.options)||void 0===e?void 0:e.css)&&(o+="&css=".concat(encodeURIComponent(this.options.css))),void 0!==this.options.showToolbarControl&&(o+="&header=".concat(this.options.showToolbarControl?"true":"false")),this.options.theme&&(o+="&theme=".concat(this.options.theme));var r=document.createElement("iframe");r.id="webviewer-"+this.docId,r.src=o,r.frameBorder=0,r.width="100%",r.height="100%",r.setAttribute("allowfullscreen",!0),r.setAttribute("webkitallowfullscreen",!0),r.setAttribute("mozallowfullscreen",!0),this.iframe=r,null!==(t=this.options)&&void 0!==t&&t.backgroundColor&&r.setAttribute("data-bgcolor",this.options.backgroundColor),null!==(i=this.options)&&void 0!==i&&i.assetPath&&r.setAttribute("data-assetpath",encodeURIComponent(this.options.assetPath)),this.element.appendChild(r),window.addEventListener("message",(function e(t){if("viewerLoaded"===t.data.type&&t.data.docId===n.docId)try{n.instance=n.iframe.contentWindow.instance}catch(e){}finally{window.removeEventListener("message",e),n._viewerLoaded(n.iframe)}}))}},{key:"_documentViewerLoaded",value:function(e){this.options.pdfUrl&&e.contentWindow.instance.UI.loadDocument(this.options.pdfUrl)}},{key:"_viewerLoaded",value:function(e){this._trigger("ready");try{e.contentWindow.postMessage({type:"viewerLoaded",options:this.options},"*")}catch(e){}}}])&&t(e.prototype,i),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,i,n}();n=c,r={path:"",webviewerPath:"./webviewer/index.html"},(o=e(o="config"))in n?Object.defineProperty(n,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[o]=r;export{i as default};
|