Skip to content

Instantly share code, notes, and snippets.

@kmithi1-apps
kmithi1-apps / ImageAnnotation.swift
Created December 6, 2024 17:21
Add stamp annotation to PDF page.
class PDFImageAnnotation: PDFAnnotation {
var image: UIImage?
convenience init(_ image: UIImage?, bounds: CGRect, properties: [AnyHashable : Any]?) {
self.init(bounds: bounds, forType: PDFAnnotationSubtype.stamp, withProperties: properties)
self.image = image
}
override func draw(with box: PDFDisplayBox, in context: CGContext) {