0

When i try to open a .pdf from URL using a TwebBrowser on Android yhe pdf don't open, just a blank windows.

TwebBrowser.Navigate('http://url/pdf/{3F6E0442-F389-4A49-8587-E02757340052}.pdf');

On win32 work fine On Android don't open the pdf.

Thanks

Dison
  • 103
  • 1
  • 1
  • 12
  • `TWebBrowser` is a wrapper around the respective native platform browser. The native win32 and iOS browsers support viewing PDF files directly, the android native browser does not. – J... Nov 09 '16 at 12:16

1 Answers1

1

Don't use the WebBrowser component. Use the default application installed for open this type of file.

uses
  Androidapi.JNI.GraphicsContentViewText,
  Androidapi.JNI.JavaTypes,
  FMX.Helpers.Android;

procedure OpenFile(pFileName:string);
var
  Intent: JIntent;
begin
  Intent := TJIntent.Create;
  Intent.setAction(TJIntent.JavaClass.ACTION_VIEW);
  Intent.setDataAndType(StrToJURI(pFileName), StringToJString('application/pdf'));
  SharedActivity.startActivity(Intent);
end;