CarloM 3 Posted August 12, 2019 Hello, I need to show a PDF in app, on iOS works well with TWebBrowser, but no in android. Any workaround, component ? Thank you 1 Share this post Link to post
Dave Nottage 563 Posted August 12, 2019 This works for 10.3.x if you have some kind of PDF viewer installed on the device: uses Androidapi.JNI.GraphicsContentViewText, Androidapi.Helpers, Androidapi.JNI.Net; procedure OpenPDF(const AFileName: string); var LIntent: JIntent; LUri: Jnet_Uri; begin LUri := TAndroidHelper.JFileToJURI(TJFile.JavaClass.init(StringToJString(AFileName))); LIntent := TJIntent.JavaClass.init(TJIntent.JavaClass.ACTION_VIEW); LIntent.setDataAndType(LUri, StringToJString('application/pdf')); LIntent.setFlags(TJIntent.JavaClass.FLAG_GRANT_READ_URI_PERMISSION); TAndroidHelper.Activity.startActivity(LIntent); end; 1 2 Share this post Link to post
FreeDelphiPascal 19 Posted November 6 (edited) Most libraries are for Windows but you can find also some PDF libraries that are cross-platform. Edited November 6 by FreeDelphiPascal Share this post Link to post