當我嘗試使用PDFDocument.init(url:)
時,我注意到它與http
配合使用,但與https
URL配合使用。有誰知道爲什麼?PDFKit的PDFDocument init(url:URL)不適用於HTTPS
import PDFKit
let httpURL = URL(string: "http://www.axmag.com/download/pdfurl-guide.pdf")!
let doc1 = PDFDocument(url: httpURL) //makes a PDFDocument
let httpsURL = URL(string: "https://www.gnu.org/s/libmicrohttpd/tutorial.pdf")!
let doc2 = PDFDocument(url: httpsURL) //nil