From f5a1f104f2e8a38f2100cadbe77d2ea69267582a Mon Sep 17 00:00:00 2001 From: Nicolas Bonamy Date: Thu, 9 May 2024 14:26:54 -0500 Subject: [PATCH] office parser fix --- src/main/text.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 {