Borderless Printing UIPrintInteractionController

A3

I am working on an iPhone application using the concept of an image for printing using the UIPrintInteractionController . I am stuck at one point, that is, border , whenever I tried to print any image using a printer, it always shows the border on all sides, which is not required. The image should use the full size of the paper, as I give the image the same size as the width and height of the paper, but at the same time it shows the border.

I did not find any method to remove the border or reduce the border of the paper contents. 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 an image from a Mac system in which it gives the opportunity for border and border less.

I think it should be present in the UIPrintInteractionController infrastructure but didn’t find anyone.

Please help me if someone has experienced this.

Thanks in advance. Your help will be appreciated.

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

A3

+5
source share
2 answers

If you want to eliminate any boundaries, you could quickly achieve this by passing photo outputType to the 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 need more control over the final rendering, you can check out the Apple sample regarding the UIPrintInteractionController

+5
source

Objective-C version

 UIPrintInteractionController *printController = [UIPrintInteractionController sharedPrintController]; printController.printingItem = someImage; controller.showsPaperSelectionForLoadedPapers=YES; UIPrintInfo *printInfo = [UIPrintInfo printInfo]; printInfo.outputType = UIPrintInfoOutputPhoto; printController.printInfo = printInfo; 
+1
source

Source: https://habr.com/ru/post/1272858/


All Articles