我正在尝试从当前View创建PDF。下面是我的代码。funccreatePdfFromView(saveToDocumentsWithFileNamefileName:String)->CGPDFDocument?{letpdfData=NSMutableData()varpdfDoc:CGPDFDocument!UIGraphicsBeginPDFContextToData(pdfData,self.view.bounds,nil)UIGraphicsBeginPDFPage()guardletpdfContext=UIGraphicsGetCurrentContext()else{