Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIPrintInteractionController borderless printing

A3

I am working on the iPhone app using print image concept using UIPrintInteractionController. I have stuck at one point i.e. border, whenever I tried to print any image using printer it always show border on all sides which is not required. Image should use whole the paper size, as I am giving the image size same as paper width and height, but still it is showing border.

I didn't find any kind of method to remove the border or make the paper content border less. See iPhone image enter image description here enter image description here

You can see in the attached image enter image description here, In this I am trying to print the image from Mac system in which it is giving option for border and border less.

I think it should be there in the UIPrintInteractionController framework, but didn't find anyone.

Please help me, if someone has experienced regarding this.

Thanks in advance. Your help will be appreciated

[![A4][4]][4]

A3

like image 336
Minkle Garg Avatar asked Oct 24 '17 19:10

Minkle Garg


2 Answers

If you want to eliminate any borders you could quickly achieve that by passing a photo outputType to a printInfo object:

let printController = UIPrintInteractionController.shared
printController.printingItem = someImage
printController.showsPaperSelectionForLoadedPapers = true

let printInfo             = UIPrintInfo.printInfo()
printInfo.outputType      = .photo
printController.printInfo = printInfo

enter image description here

Now, if you want greater control over the final rendering, you could explore Apple's sample project regarding UIPrintInteractionController

like image 197
Alladinian Avatar answered Nov 09 '22 23:11

Alladinian


Objective-C version

UIPrintInteractionController *printController = [UIPrintInteractionController sharedPrintController];
printController.printingItem = someImage;
controller.showsPaperSelectionForLoadedPapers=YES;

UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputPhoto;
printController.printInfo = printInfo;
like image 2
Ashish Avatar answered Nov 10 '22 00:11

Ashish