AlpVir Well-Known Member Licensed User Longtime User Sep 27, 2020 #1 HTMLText is a string variable that contains HTML-formatted text. With the following instructions I display this text in a WebView. Also I see an image stored in DirAssets. B4X: H=HTMLText.Replace("....................","<img border='0' src='file:///android_asset/logo.png' width=780px height=199px>") WebviewPDF.LoadHtml(h) If instead the image was stored in DirRootExternal how should I modify the code ? Thanks in advance
HTMLText is a string variable that contains HTML-formatted text. With the following instructions I display this text in a WebView. Also I see an image stored in DirAssets. B4X: H=HTMLText.Replace("....................","<img border='0' src='file:///android_asset/logo.png' width=780px height=199px>") WebviewPDF.LoadHtml(h) If instead the image was stored in DirRootExternal how should I modify the code ? Thanks in advance
AlpVir Well-Known Member Licensed User Longtime User Sep 27, 2020 #2 Resolved B4X: linktoimage = File.Combine(File.DirRootExternal, NomeFileFirma) H=TestoHTML.Replace("....................","<img border='0' src=' " & linktoimage & " ' width=231px height=51px>") Upvote 0
Resolved B4X: linktoimage = File.Combine(File.DirRootExternal, NomeFileFirma) H=TestoHTML.Replace("....................","<img border='0' src=' " & linktoimage & " ' width=231px height=51px>")
Erel B4X founder Staff member Licensed User Longtime User Sep 29, 2020 #3 Don't use File.DirRootExternal. It will be soon not accessible. Don't use files:///android_asset use XUI.FileUri. Use smart strings. Upvote 0
Don't use File.DirRootExternal. It will be soon not accessible. Don't use files:///android_asset use XUI.FileUri. Use smart strings.