Просмотр исходного кода

update: 字体文件 url 可配置

liutian 3 месяцев назад
Родитель
Сommit
5cd169b6cf
2 измененных файлов с 3 добавлено и 3 удалено
  1. 1 1
      packages/core/src/index.js
  2. 2 2
      packages/core/src/worker/compdfkit_worker.js

+ 1 - 1
packages/core/src/index.js

@@ -63,7 +63,7 @@ class ComPDFKitViewer {
     this.color = 'color'
     this.pagesPtr = []
     this.saveAction = null
-    this.webFontURL = './lib/fonts/'
+    this.webFontURL = 'https://www.compdf.com/fonts/'
     this.optionUrl = {
       // baseUrl: 'https://test-compdf.kdan.cn',
       baseUrl: 'https://wms.compdf.com',

+ 2 - 2
packages/core/src/worker/compdfkit_worker.js

@@ -47,7 +47,7 @@ let DiffInfoArray = []
 let AnnotArray = []
 let fontsJson = null
 let fontFile = null
-let webFontURL = './fonts/'
+let webFontURL = 'https://www.compdf.com/fonts/'
 
 import MessageHandler from "../message_handler"
 import { convertFileToBuffer, convertBase64ToBytes } from '../fileHandler';
@@ -161,7 +161,7 @@ class CPDFWorker {
       if (data.fileList) {
         ComPDFKitJS.opened_Font[0] = data.fileList
       }
-      if (data.webFontURL !== './lib/fonts/') {
+      if (data.webFontURL !== 'https://www.compdf.com/fonts/') {
         webFontURL = data.webFontURL
       }
       fontsJson = data.fontsJson