diff --git a/src/main/text.ts b/src/main/text.ts index 9cc311d..0ae3b62 100644 --- a/src/main/text.ts +++ b/src/main/text.ts @@ -1,4 +1,5 @@ +import { app } from 'electron' import PDFParser from 'pdf2json' import officeParser from 'officeparser' @@ -16,7 +17,9 @@ function getPDFRawTextContent(contents: string): Promise { } function getOfficeRawTextContent(contents: string): Promise { - return officeParser.parseOfficeAsync(Buffer.from(contents, 'base64')) + return officeParser.parseOfficeAsync(Buffer.from(contents, 'base64'), { + tempFilesLocation: app.getPath('temp'), + }) } export function getTextContent(contents: string, format: string): Promise {