anchor.diff:    cmd : string;
     {$ENDIF}
     list : TStringList;
  +  ris : boolean;
   begin
     Result := false;
     if not CheckPoppler_pdftotext_ExePath then
  
positive.code: 
    tempFile := IncludeTrailingPathDelimiter(GetTempDir) + mUtility.GenerateRandomIdString + '.txt';
    {$IFDEF UNIX}
    if RunCommandIndir(ExtractFileDir(aPdfFileName), Poppler_pdftotext_ExePath, [aPdfFileName, tempFile], outputString,  [poStderrToOutPut, poUsePipes, poWaitOnExit]) then
    {$ELSE}
    // UTF8ToWinCP is no longer needed, this bug in TProcess was fixed: https://gitlab.com/freepascal.org/fpc/source/-/issues/29136
    cmd := AnsiQuotedStr(aPdfFileName,'"') + ' ' + AnsiQuotedStr(tempFile,'"');
    if RunCommand(Poppler_pdftotext_ExePath, [cmd], outputString, [poNoConsole, poWaitOnExit]) then
    {$ENDIF}
    begin
      list := TStringList.Create;
      try
        list.LoadFromFile(tempFile);
        aText := list.Text;
      finally
        list.Free;
      end;
      if FileExists(tempFile) then
        DeleteFile(tempFile);
    end
  
negative.code:   end;
  end;
  
  class function TPopplerToolbox.ExtractTextFromPdf(const aPdfFileName: string; const aPreserveLayout: boolean; out aText: String): boolean;
  var
    list : TStringList;
  begin
    list := TStringList.Create;
    try
      Result := TPopplerToolbox.ExtractTextFromPdf(aPdfFileName, aPreserveLayout, list);
      if Result then
        aText := list.Text
      else
        aText := '';
    finally
      list.Free;
    end;
  end;
  
  class function TPopplerToolbox.ExtractTextFromPdf(const aPdfFileName: string; const aPreserveLayout: boolean; aLines: TStringList): boolean;
  var
    outputString : string;
    tempFile : string;
  