this is really helpful thank you!
i used this for testing that i can open the print preview within my app:
import PDFKit
class PDFManager {
func printTest() -> Error? {
let pdfView = PDFView()
pdfView.document = PDFDocument()
guard let dataRepresention = pdfView.document?.dataRepresentation() else {
print("dataRepresention is nil")
return URLError(.badURL)
}
let printInfo = UIPrintInfo(dictionary: nil)
printInfo.jobName = "Class Plan"
printInfo.outputType = .general
let printController = UIPrintInteractionController.shared
printController.printInfo = printInfo
printController.showsNumberOfCopies = true
printController.printingItem = dataRepresention
printController.present(animated: true, completionHandler: nil)
return nil
}
}
Topic:
App & System Services
SubTopic:
Networking
Tags: