D db0070 Active Member Licensed User Longtime User Feb 26, 2019 #1 I am using the DrawPDF library and I draw on the canvas a page of pdf: - Code: Copy cvs.Initialize(ScrollView1.Panel) cvs.DrawPDF(pdf, currentPage,cvs.TargetRect) cvs.Refresh I want zoom feature, so how can I capture this page and draw it on a webview?
I am using the DrawPDF library and I draw on the canvas a page of pdf: - Code: Copy cvs.Initialize(ScrollView1.Panel) cvs.DrawPDF(pdf, currentPage,cvs.TargetRect) cvs.Refresh I want zoom feature, so how can I capture this page and draw it on a webview?
Erel B4X founder Staff member Licensed User Longtime User Feb 27, 2019 #2 I think that you are using the standard Canvas object. WebView in iOS has built-in support for PDF documents. It will be easier to show the PDF file directly. Upvote 0
I think that you are using the standard Canvas object. WebView in iOS has built-in support for PDF documents. It will be easier to show the PDF file directly.
D db0070 Active Member Licensed User Longtime User Feb 27, 2019 #3 Erel said: It will be easier to show the PDF file directly. Click to expand... This is what I am using, and the problem is there is no zoom available - hence I was thinking of grabbing the image shown by DrawPDF and placing it in a webview, but I just don't know how to do that. Upvote 0
Erel said: It will be easier to show the PDF file directly. Click to expand... This is what I am using, and the problem is there is no zoom available - hence I was thinking of grabbing the image shown by DrawPDF and placing it in a webview, but I just don't know how to do that.
Erel B4X founder Staff member Licensed User Longtime User Feb 27, 2019 #4 Just tested it with WKWebView. Zoom works fine. Code: Copy Dim xui As XUI File.Copy(File.DirAssets, "Document1.pdf", File.DirDocuments, "Document1.pdf") WKWebView1.LoadUrl(xui.FileUri(File.DirDocuments, "Document1.pdf")) Upvote 0
Just tested it with WKWebView. Zoom works fine. Code: Copy Dim xui As XUI File.Copy(File.DirAssets, "Document1.pdf", File.DirDocuments, "Document1.pdf") WKWebView1.LoadUrl(xui.FileUri(File.DirDocuments, "Document1.pdf"))
D db0070 Active Member Licensed User Longtime User Feb 27, 2019 #5 1. If Document1.pdf has multiple pages, any way to copy one particular page to File.DirDocuments? 2. Why use File.DirDocuments? Upvote 0
1. If Document1.pdf has multiple pages, any way to copy one particular page to File.DirDocuments? 2. Why use File.DirDocuments?
Erel B4X founder Staff member Licensed User Longtime User Feb 28, 2019 #6 1. No. 2. You cannot load local files from File.DirAssets with WKWebView. Upvote 0