Horizontal Scroll to display PDF in Swift -
i have collection view users can download , view pdf file in web view. app landscape vertical scroll feels weird, want make scroll horizontal. possible in web view? or must use scrollview instead? in swift.
i'm using alamofire download , destination:
let documentsurl = nsfilemanager.defaultmanager().urlsfordirectory(.documentdirectory, indomains: .userdomainmask)[0] let fileurl = documentsurl.urlbyappendingpathcomponent("\(magazineobject.title).pdf") return fileurl }
here's code view pdf
class redirectmagazineviewcontroller: uiviewcontroller { @iboutlet weak var webview: uiwebview! @iboutlet weak var activityindicator: uiactivityindicatorview! var receivedata: nsurl! var receivetitle: string = "" override func viewdidload() { super.viewdidload() print("receivedata 2ndvc =>\(receivedata)") self.navigationcontroller?.navigationbarhidden = false self.title = receivetitle let documentspath = nssearchpathfordirectoriesindomains(.documentdirectory, .userdomainmask, true)[0] let filepath = "\(documentspath)/\(receivetitle).pdf" let url = nsurl(fileurlwithpath: filepath) let urlrequest = nsurlrequest(url: url) webview.loadrequest(urlrequest) activityindicator.startanimating() } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } }
pdf files inherently collection of pages not design pdf file support horizontal manner not horizontal scroll pdf file regard less display pdf in uiwebview, chrome, safari, preview, firefox, windows 8 reader
etc..`
Comments
Post a Comment