第一步:
將這行代碼替換
this.pdfSrc = pdf.createLoadingTask(this.pdfSrc);
為
let CMAP_URL = "https://unpkg.com/pdfjs-dist@2.0.943/cmaps/";
this.pdfSrc = pdf.createLoadingTask({
url: this.$route.query.pathUrl,
cMapUrl: CMAP_URL,
cMapPacked: true,
});
第二步:
在node_modules/pdfjs-dist/build/pdf.worker.js
和node_modules/pdfjs-dist/es5/build/pdf.worker.js
注釋掉一行代碼
if (data.fieldType === "Sig") {
data.fieldValue = null;
// 注釋掉底下這行 就可以顯示電子簽章
// _this3.setFlags(_util.AnnotationFlag.HIDDEN);
}