When using UIMarkupTextPrintFormatter to print multiple lines of plain HTML, a blank page is displayed first, and then a page with text. The code is as follows and very simple:
- (void) printSomething; { if (![UIPrintInteractionController isPrintingAvailable]) return; NSString* markupText =@"<html><body>THIS IS A TEST</body></html>"; UIMarkupTextPrintFormatter* printFormatter =[ [ [UIMarkupTextPrintFormatter alloc] initWithMarkupText:markupText] autorelease]; UIPrintInteractionController* printInteractionController =[UIPrintInteractionController sharedPrintController]; printInteractionController.printFormatter =printFormatter; printInteractionController.delegate =self;
Now, if I uncomment it shows PageRange = YES , one page prints as expected, BUT the UIPrintInteractionController takes a few seconds. It is enough for the user to wonder if the application is frozen.
The very first line of the UIMarkupTextPrintFormatter document says, " Instances of the UIMarkupTextPrintFormatter class contain HTML markup text for multi-page printing jobs ." It would be insanely insane if the formatter prints multiple pages, regardless of content ...
Any idea what's wrong here? Other applications do this without any problems. Thanks in advance.
ios printing
user1094853
source share