Custom content printing in iphone?
I am a new bee to iphone programming and I need some help with printing.
I have a view with UIScrollView,UIT开发者_运维知识库extView and UIImage as its subviews. I would like to print this view such that the complete content of the scroll view and text view will available be available on the printed page. I went through the UIPrintFormatter but I am not sure of how to use it for my requirement. It would be really great if someone could give me a good answer(example\sample code) for my problem.
Thanks a lot in advance!
Came randomly to this question. No answer yet! Little help from code,
- (void) didPressPrintExpenseButton {
void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) =
^(UIPrintInteractionController *pic, BOOL completed, NSError *error) {
if (!completed && error) NSLog(@"Print error: %@", error);
};
NSData *pdfData = [self generatePDFDataForPrinting];
printController.printingItem = pdfData;
[printController presentAnimated:YES completionHandler:completionHandler];
}
精彩评论