iOS Question PDF page to Image on Webview

Discussion in 'iOS Questions' started by db0070, Feb 26, 2019.

Tags:
  1. db0070

    db0070 Active Member Licensed User

    I am using the DrawPDF library and I draw on the canvas a page of pdf: -

    Code:
    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?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    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.
     
  3. db0070

    db0070 Active Member Licensed User

    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.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Just tested it with WKWebView. Zoom works fine.

    Code:
    Dim xui As XUI
    File.Copy(File.DirAssets, "Document1.pdf"File.DirDocuments, "Document1.pdf")
    WKWebView1.LoadUrl(xui.FileUri(
    File.DirDocuments, "Document1.pdf"))
     
  5. db0070

    db0070 Active Member Licensed User

    1. If Document1.pdf has multiple pages, any way to copy one particular page to File.DirDocuments?
    2. Why use File.DirDocuments?
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    1. No.

    2. You cannot load local files from File.DirAssets with WKWebView.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice