내 응용 프로그램은 현재 2480 3508 (A4 페이지)의 크기로 이미지를 만듭니다.이 이미지를 A4 페이지의 AirPrint로 보내려면 어떻게해야합니까? 일단 이미지가 만들어지면 사진을 사진 응용 프로그램에 저장하고 인쇄용으로 보내고 싶습니다. 어떤 아이디어? 감사합니다.AirPrint UIImage A4
0
A
답변
1
UIPrintInteractionController를 사용하고 이미지를 printingItem으로 설정해야합니다. 선택하는 인쇄 품질 (사진 모드 또는 표준)에 따라 기본 용지는 a4보다 작을 수 있지만 인쇄 대화 상자에서 a4를 선택할 수 있습니다.
`- (void) printImage: (UIImage *) myImage {
UIPrintInteractionController *controller = [UIPrintInteractionController sharedPrintController];
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputPhoto;
printInfo.jobName = @"Testprint";
printInfo.duplex = UIPrintInfoDuplexNone;
controller.printingItem = myImage;
controller.showsPaperSelectionForLoadedPapers = YES;
void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) =
^(UIPrintInteractionController *pic, BOOL completed, NSError *error) {
if (!completed && error)
NSLog(@"FAILED! due to error in domain %@ with error code %u",
error.domain, error.code);
NSLog(@"Completed: %s", (completed?"YES":"NO"));
};
[controller presentAnimated:YES completionHandler:completionHandler];
}`
0
SWIFT 3 VERSION
func printNow(_ image: UIImage){
let controller = UIPrintInteractionController.shared
let printInfo = UIPrintInfo.printInfo()
printInfo.outputType = .photoGrayscale//.photo
printInfo.jobName = "Testprint";
printInfo.duplex = .none
controller.printingItem = image
controller.showsPaperSelectionForLoadedPapers = false
controller.present(animated: true) { (controller, completed, error) in
if (!completed && (error != nil)) {
print("FAILED! due to error \(error.debugDescription)")
}
print("Completed: \(completed)")
}
}
관련 문제
- 1. AirPrint UIView 레이아웃
- 2. 안드로이드에서 AirPrint 프린터로 인쇄하기
- 3. iOS AirPrint- 기본 프린터 설정
- 4. 로컬로 만든 AirPrint HTML 파일
- 5. AirPrint : UIPrintInteractionController에서 기본 프린터 설정
- 6. AirPrint PDF 절단 페이지가 짧습니다.
- 7. A4 형식의 RFC 문서
- 8. CSS 서식 A4 인쇄
- 9. 기본 여백 a4 인쇄
- 10. iText, PageSize A4 - 단위
- 11. UIImage *
- 12. UIImage + NSCache 대 [UIImage imageNamed :]
- 13. UIImage *는 UIImage 대신 __NSCFArray입니다.
- 14. ePOS SDK를 사용하여 UIImage 인쇄
- 15. * iPad *에서 AirPrint 명령의 Swift 버전은 무엇입니까?
- 16. AirPrint Swift를 사용하여 텍스트 뷰의 내용을 인쇄하십시오.
- 17. iOS 장치에서 Bonjour AirPrint 서비스 만들기
- 18. AirPrint Code가 IPv6 전용 프린터에 연결됩니까?
- 19. A4 크기의 출력물 asp.net 페이지
- 20. Java A4 인쇄 가능 문서
- 21. 저장시 이미지를 만드는 방법은 A4
- 22. A4 크기의 페이지를 어떻게 생성합니까?
- 23. 런타임시 A5를 A4 형식으로 변경하십시오.
- 24. Windows Form을 A4 크기로 인쇄하십시오.
- 25. 전체 A4 페이지를 인쇄하려면 어떻게해야합니까?
- 26. HTML CSS로 인쇄 - 인쇄 A4
- 27. A4 크기의 표를 PHP로 출력
- 28. html로 A4 페이지 레이아웃을 좋아합니다.
- 29. 사이즈에 프린트하기 A4 사이즈로 프린트하기
- 30. IOS에서 A4 형식으로 PDF 인쇄