You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 325396f
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: electron/main.mjs
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -233,6 +233,17 @@ else {
233
233
try{constdocument=awaitreadSystemPDF(path),source={path,reliable:true,preserveWithoutPath:false,bytes:Buffer.from(document.bytes)};state.unkeyedAnnotationSource=source;state.annotationSources.set(path,source);constticket=randomBytes(16).toString('hex');state.tickets.set(ticket,path);return{...document,ticket};}catch{state.performance.hasDocument=false;return{error:'Could not open this PDF. Check file access and the 50 MB limit.'};}
234
234
});
235
235
ipcMain.handle('previewAnnotations:prepare',async(event,value)=>{consttarget=trustedWindow(event);if(!(valueinstanceofUint8Array)||value.byteLength>50*1024*1024)throwError('Invalid annotation PDF bytes.');constimported=awaitimportPDFAnnotations(value);windows.get(target).unkeyedAnnotationSource={bytes:Buffer.from(value),reliable:false,preserveWithoutPath:true};return{...imported,bytes:newUint8Array(awaitembedAnnotations(value,[],imported.nativeRefs))};});
if(!value||typeofvalue.title!=='string'||value.title.length>200||typeofvalue.detail!=='string'||value.detail.length>12000||typeofvalue.close!=='string'||value.close.length>100)throwError('Invalid status dialog.');
0 commit comments