|
@@ -15,7 +15,7 @@
|
|
|
#import <ComPDFKit/ComPDFKit.h>
|
|
|
#import <compdfkit_tools/compdfkit_tools.h>
|
|
|
|
|
|
-@interface CPDFViewController () <UISearchBarDelegate,CPDFViewDelegate,CPDFListViewDelegate, CPDFMoreListViewDelegate,CSearchToolbarDelegate, CPDFDisplayViewDelegate,CPDFBOTAViewControllerDelegate,CPDFSearchResultsDelegate,CPDFThumbnailViewControllerDelegate,CPDFAnnotationBarDelegate>
|
|
|
+@interface CPDFViewController () <UISearchBarDelegate,CPDFViewDelegate,CPDFListViewDelegate, CPDFMoreListViewDelegate,CSearchToolbarDelegate, CPDFDisplayViewDelegate,CPDFBOTAViewControllerDelegate,CPDFSearchResultsDelegate,CPDFThumbnailViewControllerDelegate,CPDFAnnotationBarDelegate,CPDFNoteOpenViewControllerDelegate>
|
|
|
|
|
|
@property(nonatomic, strong) NSString *filePath;
|
|
|
|
|
@@ -196,6 +196,14 @@
|
|
|
}
|
|
|
|
|
|
- (void)PDFListViewEditNote:(CPDFListView *)pdfListView forAnnotation:(CPDFAnnotation *)annotation {
|
|
|
+ if ([annotation isKindOfClass:[CPDFTextAnnotation class]]) {
|
|
|
+ CGRect rect = [self.pdfListView convertRect:annotation.bounds fromPage:annotation.page];
|
|
|
+ CPDFNoteOpenViewController *noteVC = [[CPDFNoteOpenViewController alloc]initWithAnnotation:annotation];
|
|
|
+ noteVC.delegate = self;
|
|
|
+ [noteVC showViewController:self inRect:rect];
|
|
|
+ } else if ([annotation isKindOfClass:[CPDFLinkAnnotation class]]) {
|
|
|
+
|
|
|
+ }
|
|
|
// [self.annotationManage setAnnotStyleFromAnnotations:self.pdfListView.activeAnnotations];
|
|
|
[self.annotationManage setAnnotStyleFromAnnotation:annotation];
|
|
|
}
|
|
@@ -259,24 +267,6 @@
|
|
|
self.annotationManage = [[CAnnotationManage alloc] initWithPDFView:pdfListView];
|
|
|
}
|
|
|
|
|
|
-- (void)PDFListViewChangedAnnotationType:(CPDFListView *)pdfListView forAnnotationMode:(CPDFViewAnnotationMode)annotationMode {
|
|
|
- switch (annotationMode) {
|
|
|
- case CPDFViewAnnotationModeNote:
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- break;
|
|
|
- case CPDFViewAnnotationModeHighlight:
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
#pragma mark - CPDFMorelistViewDelegate
|
|
|
|
|
|
- (void)PDFMoreListViewController:(CPDFMoreListViewController *)moreVC didSelectRow:(CPDFMoreListViewType)row {
|
|
@@ -354,4 +344,14 @@
|
|
|
[self.navigationController popViewControllerAnimated:YES];
|
|
|
}
|
|
|
|
|
|
+#pragma mark - CPDFNoteOpenViewControllerDelegate
|
|
|
+
|
|
|
+- (void)getNoteOpenViewController:(CPDFNoteOpenViewController *)noteOpenVC content:(NSString *)content isDelete:(BOOL)isDelete {
|
|
|
+ if (isDelete) {
|
|
|
+ [noteOpenVC.annotation.page removeAnnotation:noteOpenVC.annotation];
|
|
|
+ [self.pdfListView setNeedsDisplayForPage:noteOpenVC.annotation.page];
|
|
|
+ } else {
|
|
|
+ noteOpenVC.annotation.contents = content?:@"";
|
|
|
+ }
|
|
|
+}
|
|
|
@end
|