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