Khan's Notebook GCC/GNU/Linux Delphi/Window Java/Anywhere

路漫漫,长修远,我们不能没有钱
随笔 - 172, 文章 - 0, 评论 - 257, 引用 - 0
数据加载中……

IOS 4.2 AirPrint调用

#pragma mark -
#pragma mark Application lifecycle
#define pdfUrl 
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    
    // Override point for customization after application launch.
#if __IPHONE_OS_VERSION_MAX_ALLOWED > 40100
UIPrintInteractionController *controller = [UIPrintInteractionController sharedPrintController];
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.jobName = @"Air Print test";
printInfo.duplex = UIPrintInfoDuplexLongEdge;
controller.printInfo = printInfo;
controller.showsPageRange = YES;
controller.printingItem = @"asfasdf";
void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) =
^(UIPrintInteractionController *pic, BOOL completed, NSError *error) {
//self.content = nil;
if (!completed && error)
NSLog(@"FAILED! due to error in domain %@ with error code %u",
 error.domain, error.code);
};
//
// if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
// [controller presentFromRect:printBtn.frame
// inView:self.view
//   animated:YES
//  completionHandler:completionHandler];
// } else {
[controller presentAnimated:YES completionHandler:completionHandler];
// }
#endif
    [self.window makeKeyAndVisible];
    
    return YES;
}

posted on 2011-10-20 13:20 Khan 阅读(829) 评论(0)  编辑 收藏 引用 所属分类: GCC/G++


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理