CGPDFDocumentGetNumberOfPages
CGPDFDocumentGetNumberOfPages is a function within the Core Graphics framework in Apple's operating systems, including macOS and iOS. Its primary purpose is to retrieve the total number of pages contained within a Portable Document Format (PDF) document.
To use this function, a CGPDFDocumentRef object, which represents an opened PDF document, must be provided as
The CGPDFDocumentRef itself is typically obtained by loading a PDF file from a URL or data object