Im пытается распечатать изображение с помощью воздушного принтера. Все работает отлично, за исключением после того, как она напечатана страница содержит ненужную линиюИзображение с воздушной печатью, показывающее ненужные строки на странице
Вот мой код для печати
UIPrintInteractionController *controller = [UIPrintInteractionController sharedPrintController];
if(!controller){
NSLog(@"Couldn't get shared UIPrintInteractionController!");
return;
}
controller.delegate = self;
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputPhoto;
printInfo.orientation = UIPrintInfoOrientationLandscape;
printInfo.jobName = @"AirPrintSample";
controller.printInfo = printInfo;
UIImage *printImage = [self imageWithView:self.printView];
controller.printingItem = printImage;
void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
if(completed && error)
{
NSLog(@"Printing failed due to error in domain %@ with error code %lu. Localized description: %@, and failure reason: %@", error.domain, (long)error.code, error.localizedDescription, error.localizedFailureReason);
}
else
{
if(completed)
{
// Did Some Other[enter image description here][1] Stuff
}
}
};
if([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
[controller presentFromRect:self.view.frame inView:self.view animated:YES completionHandler:completionHandler];
}
else {
[controller presentAnimated:YES completionHandler:completionHandler];
}
Вот код для UIView конверсии UIImage
- (UIImage *) imageWithView:(UIView *)view
{
UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
Вот как его внешний вид, как после печати Мы видим, что есть много горизонтальных линий. Но мне нужен простой белый фон для моего лейбла. И я уверен, что не рисую эти строки на изображении, и предварительный просмотр печати также не показывает никаких строк. Спасибо, если кто-нибудь может помочь.
Модель принтера - Brother QL-720nw
Вот ссылка для печатной страницы [ссылка] (http://i.stack.imgur.com/WKyoW.jpg) –