Hi I have a CGPDFDocument object. I want to open this document by either showing it in my app or using an external application. Here is the code I have so far. in SWIFT
let cfData = CFDataCreate(kCFAllocatorDefault, UnsafePointer<UInt8>(data.File.bytes), data.File.length)
let cgDataProvider = CGDataProviderCreateWithCFData(cfData)
let cgPDFDocument = CGPDFDocumentCreateWithProvider(cgDataProvider)
You can easily display CGPDF document in swift by using the following code:
the bundled PDF document is titled "Newsletter.pdf," and "webView" is an IBOutlet to a UIWebView object.
The PDF document will display nicely, and users will be able to scroll through the document, zoom in and out, and so on.