Here swift code Before downloading the file and then I work on NSData for retrieve the height let documents = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first let writePath = documents?.appending("/myPdf.pdf") let pdf: CGPDFDocument! = CGPDFDocument(URL.init(fileURLWithPath: writePath!) as CFURL) let firstPage: CGPDFPage = pdf.page(at: 1)! let heightFirstPage :CGRect = firstPage.getBoxRect(.mediaBox) self.heightPagePdf = heightFirstPage.height; print(heightFirstPage.height)