If all you want to do is display a PDF, just use a UIWebView. It will display the PDF just like Safari with scrolling and whatnot and handle everything for you.

Dave

On May 22, 2009, at 10:35 AM, Bob Barnes wrote:

Hi,

I'm new to both Cocoa and iPhone so perhaps I've taken on something too complicated for a beginner, but I'm trying to display a PDF in a UIScrollView so that I can zoom/drag, etc. I've created a view hierarchy with a main UIView (probably should be a UIViewController, but that's another conversation) that has 3 subviews, a UIScrollView and 2 other UIView objects used to hold custom controls. I've created a PDFView as a subclass of UIView and add it as a subview of the UIScrollView. The actual drawing of the PDF is done in the drawRect method of my PDFView object using the Quartz 2D PDF drawing calls. The zooming and dragging work, however, when I scroll the view it drags too far, exposing the background of my view. I had assumed that setting the contentSize of the UIScrollView to the size of the zoomed PDF would prevent the PDFView from moving away from the edge of the view, but I'm apparently missing something.

Can someone point me to some sample code that illustrates the proper technique for drawing a PDF inside a scroller or perhaps offer some suggestions on what I might be overlooking?

Bob_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/dave%40thinbits.com

This email sent to d...@thinbits.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to