pod 'DrawPDF'
Xcode 8+
Swift 3.0, Swift 4.0
iOS 8+
ARC
var finalArray = [[String]]()
for i in 0..<1000 {
var arrColumnData = [String]()
arrColumnData.append("\(i+1)")
for _ in 0..<4{
arrColumnData.append("abc")
}
finalArray.append(arrColumnData)
}
var arrHeaderArray = [String]()
for _ in 0...4{
arrHeaderArray.append("abc")
}
let objPdfView = VPDFTableCreation()
objPdfView.CreatePDFAndSaveDocumentDirectory(pdfName: "VPDFTableCreation", width: 500, height: 580)
objPdfView.DrawPDF(TotalData:finalArray, headerData: arrHeaderArray, EachColumnWidth: [50,50,50,50,260], fontSize: 12.0, textAlignment: .center, Viewcontroller: self)
Get the PDFFile Path.
let path = objPdfView.getPDFFile()
print(path)