Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion DokuExtractorCore/PdfTextLoaderFull.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using DokuExtractorCore.Model.PdfHelper;
using DokuExtractorCore.Model;
using System.Collections;
using System.Runtime.InteropServices;

namespace DokuExtractorCore
{
Expand Down Expand Up @@ -98,7 +99,15 @@ private async Task<string> GetTextFromPdf(string pdfFilePath, bool useMd5Cache,
targetFilePath = hashPath;
}

var pdfToTextPath = Path.Combine(Environment.CurrentDirectory, "bin", "pdftotext.exe");
string pdfToTextPath = string.Empty;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
pdfToTextPath = "pdftotext";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
pdfToTextPath = Path.Combine(Environment.CurrentDirectory, "bin", "pdftotext.exe");
}

var pdfProcess = new Process();
pdfProcess.StartInfo.FileName = pdfToTextPath;
Expand Down