|
@@ -405,7 +405,7 @@ class CPDFWorker {
|
|
|
const signaturePtr = Module._InitSignature2(annotPtr)
|
|
|
|
|
|
DataArray = []
|
|
|
- Module._SaveDocumentByStream(doc, 2)
|
|
|
+ Module._SaveDocumentByStream(doc, 2, true)
|
|
|
|
|
|
const addResult = Module._AddSignSaveDocument(doc, signaturePtr, certPtr)
|
|
|
|
|
@@ -713,11 +713,9 @@ class CPDFWorker {
|
|
|
messageHandler.on('GetSelectionForWordAtPos', (data) => {
|
|
|
const { pagePtr, textPtr, start, end } = data
|
|
|
Rect = {}
|
|
|
- Module._GetSelectionForWordAtPos(pagePtr, textPtr, start.x, start.y, end.x, end.y, 5, 5)
|
|
|
PDFRange = {}
|
|
|
- Module._GetCharsRangeAtPos(pagePtr, textPtr, Rect.Left, Rect.Top, Rect.Right, Rect.Bottom, 5, 5)
|
|
|
+ const rawTextContent = Module._GetSelectionForWordAtPos(pagePtr, textPtr, start.x, start.y, 5, 5)
|
|
|
|
|
|
- const rawTextContent = Module._GetTextContent(textPtr, PDFRange.Location, PDFRange.Length)
|
|
|
const textContent = UTF8ToString(rawTextContent)
|
|
|
TextRectArray = []
|
|
|
Module._GetRects(pagePtr, textPtr, PDFRange.Location, PDFRange.Length)
|
|
@@ -3035,7 +3033,7 @@ function addToTrustedCertificates(data) {
|
|
|
|
|
|
async function copyDocument(doc, password) {
|
|
|
DataArray = []
|
|
|
- Module._SaveDocumentByStream(doc, 2);
|
|
|
+ Module._SaveDocumentByStream(doc, 2, true);
|
|
|
let pdfData = []
|
|
|
for (let i = 0; i < DataArray.length; i++) {
|
|
|
let subArray = new Uint8Array(DataArray[i])
|
|
@@ -3058,7 +3056,7 @@ async function copyDocument(doc, password) {
|
|
|
function saveDocument(doc, saveType) {
|
|
|
DataArray = []
|
|
|
saveType === 1 && DataArray.push(ComPDFKitJS.opened_files[0])
|
|
|
- Module._SaveDocumentByStream(doc, saveType)
|
|
|
+ Module._SaveDocumentByStream(doc, saveType, true)
|
|
|
let pdfData = []
|
|
|
for (let i = 0; i < DataArray.length; i++) {
|
|
|
let subArray = new Uint8Array(DataArray[i])
|