|
@@ -168,6 +168,11 @@ class CPDFWorker {
|
|
|
|
|
|
Module._InitComPDFkitFont()
|
|
Module._InitComPDFkitFont()
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (data.enableDefaultFont && !ComPDFKitJS.opened_DefFont[0]) {
|
|
|
|
+ const fontFile = readFileAsync('./DroidSansFallbackFull.ttf')
|
|
|
|
+ ComPDFKitJS.opened_DefFont[0] = fontFile
|
|
|
|
+ }
|
|
const doc = Module._InitDocument()
|
|
const doc = Module._InitDocument()
|
|
|
|
|
|
return doc
|
|
return doc
|
|
@@ -401,7 +406,7 @@ class CPDFWorker {
|
|
|
|
|
|
DataArray = []
|
|
DataArray = []
|
|
|
|
|
|
- const embedded = !!fontsJson
|
|
|
|
|
|
+ const embedded = !!fontsJson || ComPDFKitJS.opened_DefFont[0]
|
|
Module._SaveDocumentByStream(doc, 2, embedded)
|
|
Module._SaveDocumentByStream(doc, 2, embedded)
|
|
|
|
|
|
const addResult = Module._AddSignSaveDocument(doc, signaturePtr, certPtr)
|
|
const addResult = Module._AddSignSaveDocument(doc, signaturePtr, certPtr)
|
|
@@ -3067,7 +3072,7 @@ function addToTrustedCertificates(data) {
|
|
async function copyDocument(doc, password) {
|
|
async function copyDocument(doc, password) {
|
|
DataArray = []
|
|
DataArray = []
|
|
|
|
|
|
- const embedded = !!fontsJson
|
|
|
|
|
|
+ const embedded = !!fontsJson || ComPDFKitJS.opened_DefFont[0]
|
|
Module._SaveDocumentByStream(doc, 2, embedded);
|
|
Module._SaveDocumentByStream(doc, 2, embedded);
|
|
let pdfData = []
|
|
let pdfData = []
|
|
for (let i = 0; i < DataArray.length; i++) {
|
|
for (let i = 0; i < DataArray.length; i++) {
|
|
@@ -3092,7 +3097,7 @@ function saveDocument(doc, saveType) {
|
|
DataArray = []
|
|
DataArray = []
|
|
saveType === 1 && DataArray.push(ComPDFKitJS.opened_files[0])
|
|
saveType === 1 && DataArray.push(ComPDFKitJS.opened_files[0])
|
|
|
|
|
|
- const embedded = !!fontsJson
|
|
|
|
|
|
+ const embedded = !!fontsJson || ComPDFKitJS.opened_DefFont[0]
|
|
Module._SaveDocumentByStream(doc, saveType, embedded)
|
|
Module._SaveDocumentByStream(doc, saveType, embedded)
|
|
let pdfData = []
|
|
let pdfData = []
|
|
for (let i = 0; i < DataArray.length; i++) {
|
|
for (let i = 0; i < DataArray.length; i++) {
|