내 응용 프로그램에서 사용자가 iPhone 또는 iPad의 문서 또는 페이지를 인쇄하도록 허용하려면 어떻게해야합니까? 인쇄를 지원하는 iOS 버전은 무엇입니까?iPhone 및 iPad 앱에서 인쇄 할 수 있습니까?
7
A
답변
6
iOS 4.2 이상을 실행중인 모든 멀티 태스킹 가능 장치에서 인쇄 할 수 있습니다. 자세한 내용은 다음을 참조하십시오. http://developer.apple.com/library/ios/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/Printing/Printing.html#//apple_ref/doc/uid/TP40010156-CH12-SW1
17
다음은 간단한 코드입니다.
-(void)printItem {
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, YES, 0);
CGContextRef context = UIGraphicsGetCurrentContext();
[self.view.layer renderInContext:context];
UIImage *imageFromCurrentView = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIPrintInteractionController *printController = [UIPrintInteractionController sharedPrintController];
printController.printingItem = imageFromCurrentView;
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGrayscale;
printController.printInfo = printInfo;
printController.showsPageRange = YES;
void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
if (!completed && error) {
NSLog(@"FAILED! due to error in domain %@ with error code %u", error.domain, error.code);
}
};
[printController presentAnimated:YES completionHandler:completionHandler];
}
관련 문제
- 1. iPad 및 iPhone 앱에서 메모리 누수가 발생했습니다.
- 2. iPhone 앱에서 캘린더를 구독 할 수 있습니까?
- 3. iPad/iPhone 앱에서 inApp 구매
- 4. 업데이트를 통해 iPhone-App에 iPad 기능을 도입 할 수 있습니까?
- 5. iPhone/iPad 앱에서 이미지 복사 방지 방법
- 6. 앱에서 iPad/iPhone 라이브러리로 오디오 파일 저장
- 7. 앱에서 iPad/iPhone 고유 정보를 얻으세요.
- 8. WPF 및 IPAD \ IPHONE
- 9. ipad 호환을 위해 iphone 앱에서 얼마를 변경해야합니까?
- 10. 브라우저에서 iPhone/iPad 방향이 변경되는 것을 방지 할 수 있습니까?
- 11. AS3 Packager for iPhone : 앱에서 콘텐츠를 다운로드 할 수 있습니까?
- 12. iphone/ipad 앱에서 iPhone 캘린더에 여러 이벤트를 추가하는 방법은 무엇입니까?
- 13. iPhone/iPad 화면의 현재 방향을 어떻게 쿼리 할 수 있습니까?
- 14. iPad 및 iPhone 방향 질문
- 15. Django 앱에서 인쇄 할 때 어디로 이동합니까?
- 16. iPad 및 iPhone 모두에서 내 iPhone 앱의 아이콘을 올바르게 표시 할 수 있습니까?
- 17. iPhone 앱에서 다이얼러 인터페이스를 표시 할 수 있습니까?
- 18. iPhone/Android 앱에서 통화 중에 마이크에 액세스 할 수 있습니까?
- 19. iPhone 앱에서 "스크린 샷"기능을 제거 할 수 있습니까?
- 20. iPhone 앱에서 다른 앱을 판매 할 수 있습니까?
- 21. iPhone 앱에서 웹 클립을 생성 할 수 있습니까?
- 22. iOS 앱에서 rsync를 사용할 수 있습니까?
- 23. iPad 앱에서 DetailViewController의 속성을 설정할 수 없습니다.
- 24. iPhone 앱에서 부검을 사용할 수 있습니까?
- 25. iPhone/iPad 앱의 "부분적인"웹보기
- 26. Twitter iPad 앱에서 볼 수있는 회전 및 애니메이션 효과를 어떻게 복제 할 수 있습니까?
- 27. iPad 및 iPhone 방향 질문
- 28. iphone 및 ipad 개발의 차이점
- 29. iAds는 iPad 앱에서 사용할 수 없습니까?
- 30. 네이티브 iPad 앱에서 QTVR 파일을 사용할 수 있습니까?