I have a project where I let the user draw on the screen of the iPhone (signature box). It works great... prints to a specific label printer (Zebra gx420d). My question is as follows: Can I have a UILabel field be part of the "Image" that is drawn? It is visi开发者_JAVA百科ble on screen, but doesn't print.
Any help would be appreciated!
Just make sure the label and your custom view subclass that draws the signature are both subviews of a common superview. Then invoke print on the common superview, and both of them (actually all subviews) will be part of the printed image.
You need to draw the text into an image graphics context.
This question may help: How do I use the NSString draw functionality to create a UIImage from text
精彩评论