iosobjective-cuiprintinteractioncntrleruiprintformatter

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


Solution

  • 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