'extract image from stamp pdf annotation on PDFViewAnnotationHit notification

I want to know how I can extract image from Stamp Pdf annotation when PDFViewAnnotationHit notification triggered.

We have pdf notification when we touch pdf annotation i.e.

NotificationCenter.default.addObserver(self, selector: #selector(annotationHit(notification:)), name: NSNotification.Name.PDFViewAnnotationHit, object: nil)

and it's triggered succesfully when touch detected on Pdf annotation

@objc func annotationHit(notification: Notification) {
    
    if let annotationInfo = notification.userInfo!["PDFAnnotationHit"] as? PDFAnnotation{
        
    }
}

Problem is I want to fetch saved stamp as UIImage from above notification method.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source