我不明白为什么 * CGPDFDocumentCreateWithURL* 返回 nil。该文件未加密,没有密码,是一个带有文本内容的简单 pdf。是什么原因造成的。
var pdfDoc: CGPDFDocument!
pdfDoc = CGPDFDocumentCreateWithURL(url)// the value is nil even though url and pdf file are valid
let pdfCatalog=CGPDFDocumentGetCatalog(pdfDoc)
请注意文件确实存在且url有效
最佳答案
通过在路径中添加“file:///”解决了问题。 https://forums.developer.apple.com/message/113941#113941
关于ios - CGPDFDocumentCreateWithURL 在任何 PDF 文件上返回 nil,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35392218/