CGPDFDocumentGetPage
CGPDFDocumentGetPage is a function provided by the Core Graphics framework in macOS and iOS. It is used to retrieve a specific page from a PDF document. This function is part of the Quartz 2D API, which is a two-dimensional drawing engine used for rendering vector graphics and text.
The function takes two parameters: a reference to a CGPDFDocument object and an integer representing the page
If the specified page number is less than 1 or greater than the number of pages in
Here is a simple example of how to use CGPDFDocumentGetPage:
CGPDFDocumentRef pdfDocument = CGPDFDocumentCreateWithURL((__bridge CFURLRef)pdfURL);
CGPDFPageRef pdfPage = CGPDFDocumentGetPage(pdfDocument, 1);
// Use the pdfPage object as needed
}
CGPDFDocumentRelease(pdfDocument);
```
In this example, a PDF document is created from a URL, and the first page of the