D Declan Well-Known Member Licensed User Longtime User May 8, 2017 #1 I am using the following to render a PDF to a WebView: B4X: wvPDF.LoadHtml("<HTML><HEAD></HEAD><BODY><IMG SRC='file://" & ImagePath & "' /></BODY></HTML>") The render is fine, but it only consumes about 50% of the WebView width. Is it possible to "Zoom" the image so that it fits the entire width of the WebView?
I am using the following to render a PDF to a WebView: B4X: wvPDF.LoadHtml("<HTML><HEAD></HEAD><BODY><IMG SRC='file://" & ImagePath & "' /></BODY></HTML>") The render is fine, but it only consumes about 50% of the WebView width. Is it possible to "Zoom" the image so that it fits the entire width of the WebView?
Erel B4X founder Staff member Licensed User Longtime User May 8, 2017 #2 B4X: WebView1.LoadHtml($" <img src="${WebViewAssetFile("image.png")}" style="width: 100%;height: 100%y;"/> "$) WebViewAssetFile = https://www.b4x.com/android/forum/t...es-in-the-assets-directory.69996/#post-444559 Use File.Combine for non-asset files. Upvote 0
B4X: WebView1.LoadHtml($" <img src="${WebViewAssetFile("image.png")}" style="width: 100%;height: 100%y;"/> "$) WebViewAssetFile = https://www.b4x.com/android/forum/t...es-in-the-assets-directory.69996/#post-444559 Use File.Combine for non-asset files.
D Declan Well-Known Member Licensed User Longtime User May 9, 2017 #3 Erel said: B4X: WebView1.LoadHtml($" <img src="${WebViewAssetFile("image.png")}" style="width: 100%;height: 100%y;"/> "$) WebViewAssetFile = https://www.b4x.com/android/forum/t...es-in-the-assets-directory.69996/#post-444559 Use File.Combine for non-asset files. Click to expand... Thanks Erel. This works great: B4X: WebView1.LoadHtml($"<img src="${ImagePath}" style="width: 100%;height: 100%y;"/>"$) Upvote 0
Erel said: B4X: WebView1.LoadHtml($" <img src="${WebViewAssetFile("image.png")}" style="width: 100%;height: 100%y;"/> "$) WebViewAssetFile = https://www.b4x.com/android/forum/t...es-in-the-assets-directory.69996/#post-444559 Use File.Combine for non-asset files. Click to expand... Thanks Erel. This works great: B4X: WebView1.LoadHtml($"<img src="${ImagePath}" style="width: 100%;height: 100%y;"/>"$)