Delphi 10.3.3 How to view pdf file on Ubuntu

  

My app downloads the file from the server and it saves the file in the default download directory.
How can I open the file after downloading to view it.

try
MS := TMemoryStream.Create;
try
Http.Request.BasicAuthentication:= true;
Http.Request.Username := ‘*****’;
Http.Request.Password := ‘****’;
Http.Get(‘http://’+serverIP+’:8080/api/getpdf/’+fType, MS);
MS.Position:=0;
{$IFDEF MSWINDOWS}
MS.SaveToFile(fl);
{$ENDIF}
{$IFDEF LINUX}
MS.SaveToFile(fl);
{$ENDIF}
{$IFDEF ANDROID}
if PermissionsService.IsPermissionGranted(JStringToString(TJManifest_permission.JavaClass.WRITE_EXTERNAL_STORAGE)) then
begin
MS.SaveToFile(fl);
end;
{$ENDIF}
previewFile(fl,fType);<————–
finally
MS.Free;
end;
finally
Http.Free;
end;

In windows platform I do:

ShellExecute(0, ‘open’,PChar(fl),nil,nil,0)

Any suggestion for Linux?

Comments are closed.