The press for printing on the iPad does not display UILabels. When I increase the print preview, it displays correctly. When I changed the UILabel property opaqueto true, it will change the background of the UILabel to black and display it in preview. This is the code I used to show the preview.
let printController = UIPrintInteractionController.shared
let printInfo = UIPrintInfo(dictionary:nil)
printInfo.outputType = UIPrintInfoOutputType.general
printInfo.jobName = "Print"
printInfo.duplex = UIPrintInfoDuplex.none
printInfo.orientation = UIPrintInfoOrientation.portrait
printController.printPageRenderer = nil
printController.printingItems = nil
printController.printingItem = printUrl
printController.printInfo = printInfo
printController.showsNumberOfCopies = true
printController.showsPaperSelectionForLoadedPapers = true
printController.present(animated: true, completionHandler: nil)
When I change UIPrintInfoOutputType.generalto UIPrintInfoOutputType.grayscale, it displays UILabels, but I need color printing. Grayscale for black and white printing only. A.
source
share