开发者

iPhone UIWebView PDF Page Jump

开发者 https://www.devze.com 2022-12-15 13:36 出处:网络
I want to view a local PDF (in my iPhone app) and be able to jump to a specific page.Seems like the UIWeb开发者_JAVA技巧View is the way to go, however, I can\'t find any information on jumping to spec

I want to view a local PDF (in my iPhone app) and be able to jump to a specific page. Seems like the UIWeb开发者_JAVA技巧View is the way to go, however, I can't find any information on jumping to specific pages. Is this impossible? Are there any other techniques I can use?

thanks, Howie


You can try using Javascript. See this link for more details. You'll want to use something along the lines of @"window.scrollTo(0, x);", where x is some value you determined by playing around with the WebView.


Another option would be to set the content offset of the UIWebView like Mike pointed out (but without involving JavaScript):

webView.ScrollView.SetContentOffset(new PointF(0, y), true);

(sorry for the MonoTouch code but ObjectiveC is still on my todo list)


Alternatively to an UIWebView, you can use the Quartz API :http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html

It's more complicated, but you should be able to do whatever you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消