I am trying to create a PDF from a UIView
which may contain images, labels, etc.
I have checked the reference ( GeneratingPDF) and I am also aware of the rend
I've had a moderate amount of luck just walking my view hierarchy, and calling -drawRect: myself. There's a bit of set up that you've got do before each, like translating the ctm and clearing the text matrix, but when you've done that for each view, you can do this:
UIGraphicsPushContext(ctx);
[self drawRect:self.frame];
UIGraphicsPopContext();
The PDF it generates is vector based -- not just a flat bitmap, so it scales nicely and you can select the text in a viewer/browser. This only works on plain vanilla custom drawing and very simple stuff like UILabels. I doubt it would work with more complex UIKit objects (I'm thinking table views and scroll views). Also, you would need extra work for UIImageViews (which I'm guessing set the contents property of the layer with a CGImageRef), and if you've got other layer based attributes and transforms -- even more work.
Hopefully Apple will give us a better solution than maintaining parallel draw code!