// // CPDFClipView.m // PDFViewer // // Created by kdanmobile_2 on 2022/12/23. // #import "PDFWatermarkClipView.h" @implementation PDFWatermarkClipView - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.backgroundColor = [UIColor clearColor]; } return self; } - (void)drawRect:(CGRect)rect { [super drawRect:rect]; CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(context, [UIColor grayColor].CGColor); CGContextFillRect(context, self.frame); CGContextClearRect(context,_documentRect); } @end