0

I've got some code to print screenshot. The problem is that instead of 'fit' image, default action is to 'fill' paper with image, what causes stretches. In case of printing screen of iphone (eg non-retina) it is looking awful.

I can't find property or any way to print the image without stretching it, can anyone help with this?

// print
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputPhoto;
printInfo.jobName = [NSString stringWithFormat:@"something")];
pic.printInfo = printInfo;

UIPrintFormatter *printFormatter = [[UIPrintFormatter alloc] init];
[printFormatter setMaximumContentHeight:image.size.height];
[printFormatter setMaximumContentWidth:image.size.width];
pic.printFormatter = printFormatter;

pic.printingItem = image; //low-res image
Nat
  • 12,032
  • 9
  • 56
  • 103
  • I create image with resolution lets say 500px:300px. When i try to print it, it's stretched to fill paper. Will paste some more important parts of code. – Nat Feb 01 '13 at 13:04

1 Answers1

0

You have probably to set the contentInsets. Use the UIEdgeInsets UIEdgeInsetsMake ( CGFloat top, CGFloat left, CGFloat bottom, CGFloat right ); Function to set the contentInsets.

Areal-17
  • 406
  • 3
  • 10