Browse Source

【综合】搜索列表整理代码

tangchao 3 months ago
parent
commit
ecd48506c8
39 changed files with 304 additions and 155 deletions
  1. 0 1
      PDF Office/KMComponentLibrary/KMComponentLibrary/View/Input/ComponentTextarea/ComponentTextarea.xib
  2. 1 1
      PDF Office/PDF Master/Class/PDFTools/Insert/KMPDFInsertWindowController.swift
  3. 8 2
      PDF Office/PDF Master/Class/PDFTools/PageEdit/Tools/KMPageEditTools.swift
  4. 6 2
      PDF Office/PDF Master/Class/PDFTools/Print/Presenter/KMPrintPresenter_C.swift
  5. 3 1
      PDF Office/PDF Master/Class/PDFTools/Redact/Tools/KMRedactTools.swift
  6. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/ComPDFKit
  7. 2 8
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFDocument.h
  8. 1 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFKit.h
  9. 3 0
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFKitConfig+Private.h
  10. 0 1
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFKitConfig.h
  11. 0 3
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFPage+Protected.h
  12. 2 6
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFPageMetalView.h
  13. 0 3
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFPageView_Mac.h
  14. 5 5
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFView+Editing.h
  15. 1 17
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFView.h
  16. 0 23
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CTaskQueueManager.h
  17. 0 1
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/ComPDFKit.h
  18. 1 1
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Modules/module.modulemap
  19. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Resources/Assets.car
  20. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Resources/CPDFUnlockViewController.nib/keyedobjects-101300.nib
  21. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Resources/CPDFUnlockViewController.nib/keyedobjects.nib
  22. 7 7
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Resources/Info.plist
  23. BIN
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Resources/default.metallib
  24. 37 48
      PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/_CodeSignature/CodeResources
  25. 3 1
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/From/KMFormModel.swift
  26. 1 1
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController.swift
  27. 27 1
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Search/KMBotaSearchViewController.swift
  28. 12 0
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Search/KMBotaSearchViewController.xib
  29. 7 4
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/Base/KMPDFThumbViewBaseController.swift
  30. 6 4
      PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/KMThumbnailViewController.swift
  31. 3 1
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift
  32. 6 2
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+MenuAction.swift
  33. 4 2
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailManager.swift
  34. 6 3
      PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailBaseViewController+Action.swift
  35. 1 1
      PDF Office/PDF Master/KMClass/KMPDFViewController/EditTool/SinglePagePDFController/KMEditDocumentController.swift
  36. 5 5
      PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift
  37. 55 0
      PDF Office/PDF Master/KMClass/Left/Search/View/KMNBotaSearchTopView.swift
  38. 67 0
      PDF Office/PDF Master/KMClass/Left/Search/View/KMNBotaSearchTopView.xib
  39. 24 0
      PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj

+ 0 - 1
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Input/ComponentTextarea/ComponentTextarea.xib

@@ -40,7 +40,6 @@
                                             <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                             <size key="minSize" width="312" height="48"/>
                                             <size key="maxSize" width="385" height="10000000"/>
-                                            <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                         </textView>
                                     </subviews>
                                 </clipView>

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Insert/KMPDFInsertWindowController.swift

@@ -260,7 +260,7 @@ class KMPDFInsertWindowController: KMBaseWindowController {
                 }
 
                 for number in fileAttribute?.fetchSelectPages() ?? [] {
-                    if let page = insertPDF?.page(at: UInt(number-1)).copy() as? CPDFPage {
+                    if let page = insertPDF?.page(at: UInt(number-1))?.copy() as? CPDFPage {
                         pages.append(page)
                         
                         indexs.insert(number-1)

+ 8 - 2
PDF Office/PDF Master/Class/PDFTools/PageEdit/Tools/KMPageEditTools.swift

@@ -30,7 +30,10 @@ class KMPageEditTools: NSObject {
         /// 提取的页面
         var extractPages: Array<CPDFPage> = []
         for i in pageIndexs {
-            extractPages.append(document.page(at: UInt(i)))
+            guard let page = document.page(at: UInt(i)) else {
+                continue
+            }
+            extractPages.append(page)
         }
         
         if (oneDocument) { /// 提取为一个文档
@@ -182,7 +185,10 @@ class KMPageEditTools: NSObject {
         var pages: Array<CPDFPage> = []
         for i in 0 ..< document.pageCount {
             if (selectedIndexs.contains(IndexSet.Element(i))) {
-                pages.append(document.page(at: i))
+                guard let page = document.page(at: i) else {
+                    continue
+                }
+                pages.append(page)
             }
             
         }

+ 6 - 2
PDF Office/PDF Master/Class/PDFTools/Print/Presenter/KMPrintPresenter_C.swift

@@ -200,7 +200,9 @@ extension KMPrintPresenter_C: KMPrintPresenter_CDocument {
     func fetchPages(documentURL: URL, range: KMPrintPageRange) -> [CPDFPage] {
         let document = CPDFDocument.init(url: documentURL)!
         if document.pageCount < 1 {
-            let page: CPDFPage = document.page(at: 0)
+            guard let page: CPDFPage = document.page(at: 0) else {
+                return []
+            }
             return [page]
         } else {
             var pagesArray: [CPDFPage] = []
@@ -237,7 +239,9 @@ extension KMPrintPresenter_C: KMPrintPresenter_CDocument {
 //                }
             case .custom:
                 for index in range.selectPages {
-                    let page: CPDFPage = document.page(at: UInt(index - 1))
+                    guard let page: CPDFPage = document.page(at: UInt(index - 1)) else {
+                        continue
+                    }
                     pagesArray.append(page)
                 }
 

+ 3 - 1
PDF Office/PDF Master/Class/PDFTools/Redact/Tools/KMRedactTools.swift

@@ -10,7 +10,9 @@ import Cocoa
 class KMRedactTools: NSObject {
     class func eraserDocument(_ document: CPDFDocument, callback: @escaping (_ result: Bool, _ errorAnno: CPDFAnnotation?) -> ()) {
         for i in 0 ..< document.pageCount {
-            let page: CPDFPage = document.page(at: i)
+            guard let page: CPDFPage = document.page(at: i) else {
+                continue
+            }
             for anno in page.annotations {
                 if ((anno.isKind(of: CPDFRedactAnnotation.self)) == false) {
                     continue

BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/ComPDFKit


+ 2 - 8
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFDocument.h

@@ -347,8 +347,6 @@ extern CPDFDocumentWriteOption const CPDFDocumentAllowsFormFieldEntryOption;
  * A array of document’s bookmarks.
  */
 - (NSArray<CPDFBookmark *> *)bookmarks;
-
-- (void)bookmarksBlock:(void(^)(NSArray<CPDFBookmark *> *))block;
 /**
  * Add a bookmark at the specified index number.
  *
@@ -368,7 +366,6 @@ extern CPDFDocumentWriteOption const CPDFDocumentAllowsFormFieldEntryOption;
  */
 - (CPDFBookmark *)bookmarkForPageIndex:(NSUInteger)pageIndex;
 
-- (void)bookmarkForPageIndex:(NSUInteger)pageIndex block:(void (^)(CPDFBookmark *bookmark))block;
 #pragma mark - Watermark
 
 /**
@@ -465,7 +462,7 @@ extern CPDFDocumentWriteOption const CPDFDocumentAllowsFormFieldEntryOption;
  *
  * @discussion Indexes are zero based. This method raises an exception if index is out of bounds.
  */
-- (CPDFPage *)pageAtIndex:(NSUInteger)index;
+- (CPDFPage *_Nullable)pageAtIndex:(NSUInteger)index;
 
 /**
  * Gets the index number for the specified page.
@@ -508,10 +505,7 @@ extern CPDFDocumentWriteOption const CPDFDocumentAllowsFormFieldEntryOption;
  * @discussion This method raises an exception if either index value is out of bounds.
  */
 - (BOOL)importPages:(NSIndexSet *)indexSet fromDocument:(CPDFDocument *)document atIndex:(NSUInteger)index;
-/**
- * Retrieve the page data
- */
-- (void)refreshPageData;
+
 #pragma mark - Annotations
 
 /**

+ 1 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFKit.h

@@ -43,6 +43,7 @@ typedef NS_ENUM(NSInteger, CPDFKitFeatureType) {
     CPDFKitFeatureConversionDigitalSignature,
     CPDFKitFeatureConversionAllowsEditText,
     CPDFKitFeatureConversionAllowsEditImage,
+    CPDFKitFeatureConversionCompressFile,
 
 };
 

+ 3 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFKitConfig+Private.h

@@ -18,6 +18,7 @@ typedef NS_ENUM(NSInteger, FreeHandPenStyle) {
 };
 
 @interface CPDFKitConfig () {
+    dispatch_queue_t _queue;
     dispatch_queue_t _searchQueue;
 }
 
@@ -47,6 +48,8 @@ typedef NS_ENUM(NSInteger, FreeHandPenStyle) {
 @property (nonatomic,strong) CPDFKitPlatformColor  *enableLinkFieldHighlightColor DEPRECATED_MSG_ATTRIBUTE("The api is currently in beta and Untested");
 @property (nonatomic,assign) BOOL isShowReadOnlySignatureAnnotation DEPRECATED_MSG_ATTRIBUTE("The api is currently in beta and Untested");
 
+- (dispatch_queue_t)queue;
+
 - (dispatch_queue_t)searchQueue;
 
 @end

+ 0 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFKitConfig.h

@@ -13,7 +13,6 @@
 #import <Foundation/Foundation.h>
 #import <ComPDFKit/CPDFKitPlatform.h>
 #import <ComPDFKit/CPDFView.h>
-#import <ComPDFKit/CTaskQueueManager.h>
 
 #define CPDFKitShareConfig [CPDFKitConfig sharedInstance]
 

+ 0 - 3
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFPage+Protected.h

@@ -49,9 +49,6 @@
 // Returns a selection representing text between startPt and endPt. Points are sorted first top to bottom, left to right.
 - (CPDFSelection *)selectionFromPoint:(CGPoint)startPoint toPoint:(CGPoint)endPoint;
 
-// Gets the unique identifier of the page, if not returned -1
-- (NSInteger)getPageObjNum;
-
 #pragma mark - Redact
 
 - (BOOL)erasureRedactFromRect:(CGRect)rect DEPRECATED_MSG_ATTRIBUTE("The api is currently in beta and Untested");

+ 2 - 6
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFPageMetalView.h

@@ -21,20 +21,16 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, assign) CPDFDisplayBox displayBox;
 @property (nonatomic, assign) CPDFPageDrawOptions options;
 @property (nonatomic, assign) CGFloat scaleFactor;
-//@property (nonatomic, assign) CPDFView *pdfView;
+@property (nonatomic, assign) CPDFView *pdfView;
 @property (nonatomic, assign) CPDFDisplayMode model;
 @property (nonatomic, strong) CPDFKitPlatformColor *displayModeCustomColor;
-
-@property (nonatomic,assign) CPDFViewScrollState scrollState;
-@property (nonatomic,assign) CPDFViewScaleState scaleState;
+@property (nonatomic, assign) CGSize renderSize;
 
 /**
  默认render只渲染page不包含参数设置
  */
 - (void)renderNeedReset:(BOOL)needReset completion:(void (^)(void))completion;
 - (void)clearRender;
-- (void)updateVisibleRect;
-- (void)updateHighlightAnnotationLayer;
 @end
 
 NS_ASSUME_NONNULL_END

+ 0 - 3
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFPageView_Mac.h

@@ -37,8 +37,6 @@
 
 @property (nonatomic,strong) CPDFPage *page;
 
-@property (nonatomic, assign) NSInteger pageIndex;
-
 @property (nonatomic, weak) id<CPDFPageViewLayerLoadingDelegate> loadingDelegate;
 
 #pragma mark - Display
@@ -50,7 +48,6 @@
 - (void)updateHighlightAnnotationLayer;
 
 - (void)renderNeedReset:(BOOL)needReset;
-- (void)updateVisibleRect;
 
 - (BOOL)isLayerFinshedDisplay;
 

+ 5 - 5
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFView+Editing.h

@@ -99,16 +99,16 @@ typedef NS_OPTIONS(NSInteger, CEditingSelectState) {
  */
 @property (nonatomic,assign) BOOL isShowEditingAreaHover;
 
+/**
+ * Whether the reference AreaItem line is displayed When enter edit
+ */
+@property (nonatomic,assign) BOOL isShowEditingAreaItemHover;
+
 /* *
  * Whether to support hover changes when moving the mouse
  */
 @property (nonatomic,assign) BOOL isShowMouseAreaHover;
 
-/**
- * Whether All EditingArea show Area Dot when enter Edit
- */
-@property (nonatomic,assign) BOOL isShowAllEditingAreaDotHover;
-
 /**
  * Hover border color of mouse placed text block.
  */

+ 1 - 17
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CPDFView.h

@@ -53,19 +53,6 @@ typedef NS_OPTIONS(NSInteger, CPDFAreaOfInterest) {
 };
 
 @class CPDFView, CPDFDocument, CPDFPage, CPDFSelection, CPDFFreeTextAnnotation, CPDFDestination, CPDFAction,CPDFEditArea,CPDFEditImageArea,CPDFBorder,CPDFEditPathArea;
-typedef NS_ENUM(NSInteger, CPDFViewScrollState) {
-    CPDFViewScrollStateBegin,
-    CPDFViewScrollStateScrolling,
-    CPDFViewScrollStateEnd,
-};
-
-typedef NS_ENUM(NSInteger, CPDFViewScaleState) {
-    CPDFViewScaleStateBegin,
-    CPDFViewScaleStateChange,
-    CPDFViewScaleStateEnd,
-};
-
-@class CPDFView, CPDFDocument, CPDFPage, CPDFSelection, CPDFFreeTextAnnotation, CPDFDestination, CPDFAction,CPDFEditArea,CPDFEditImageArea,CPDFBorder;
 
 @protocol CPDFViewDelegate <NSObject>
 
@@ -138,6 +125,7 @@ typedef NS_ENUM(NSInteger, CPDFViewScaleState) {
 @end
 
 @interface CPDFView : NSView
+
 #pragma mark - Document
 
 // Methods for associating a CPDFDocument with a CPDFView.
@@ -184,10 +172,6 @@ typedef NS_ENUM(NSInteger, CPDFViewScaleState) {
 // PDF displayed. For continuous modes this is a "fit width" behavior, for non-continuous modes it is a "best fit" behavior.
 @property (nonatomic,assign) BOOL autoScales;
 
-@property (nonatomic,assign) CPDFViewScrollState scrollState;
-
-@property (nonatomic,assign) CPDFViewScaleState scaleState;
-
 - (IBAction)zoomIn:(id)sender;
 @property (nonatomic, readonly) BOOL canZoomIn;
 

+ 0 - 23
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/CTaskQueueManager.h

@@ -1,23 +0,0 @@
-//
-//  CTaskQueueManager.h
-//  ComPDFKit
-//
-//  Created by lizhe on 2024/11/5.
-//  Copyright © 2024 Kdan Mobile. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface CTaskQueueManager : NSObject
-+ (instancetype)sharedManager;
-
-// 提交异步任务
-- (void)submitAsyncTask:(dispatch_block_t)task;
-
-// 提交同步任务(自动避免死锁)
-- (void)submitSyncTask:(dispatch_block_t)task;
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Headers/ComPDFKit.h

@@ -14,7 +14,6 @@
 #import <ComPDFKit/CPDFKitPlatform.h>
 #import <ComPDFKit/CPDFKitConfig.h>
 #import <ComPDFKit/CPDFKitConfig+Private.h>
-#import <ComPDFKit/CTaskQueueManager.h>
 
 #import <ComPDFKit/CPDFDocument.h>
 #import <ComPDFKit/CPDFDocument+Protected.h>

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Modules/module.modulemap

@@ -1,6 +1,6 @@
 framework module ComPDFKit {
   umbrella header "ComPDFKit.h"
-  export *
 
+  export *
   module * { export * }
 }

BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Resources/Assets.car


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Resources/CPDFUnlockViewController.nib/keyedobjects-101300.nib


BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Resources/CPDFUnlockViewController.nib/keyedobjects.nib


+ 7 - 7
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Resources/Info.plist

@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
 	<key>BuildMachineOSBuild</key>
-	<string>23A344</string>
+	<string>21E230</string>
 	<key>CFBundleDevelopmentRegion</key>
 	<string>en</string>
 	<key>CFBundleExecutable</key>
@@ -27,19 +27,19 @@
 	<key>DTCompiler</key>
 	<string>com.apple.compilers.llvm.clang.1_0</string>
 	<key>DTPlatformBuild</key>
-	<string></string>
+	<string>13A233</string>
 	<key>DTPlatformName</key>
 	<string>macosx</string>
 	<key>DTPlatformVersion</key>
-	<string>14.2</string>
+	<string>11.3</string>
 	<key>DTSDKBuild</key>
-	<string>23C53</string>
+	<string>20E214</string>
 	<key>DTSDKName</key>
-	<string>macosx14.2</string>
+	<string>macosx11.3</string>
 	<key>DTXcode</key>
-	<string>1520</string>
+	<string>1300</string>
 	<key>DTXcodeBuild</key>
-	<string>15C500b</string>
+	<string>13A233</string>
 	<key>LSMinimumSystemVersion</key>
 	<string>10.11</string>
 </dict>

BIN
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/Resources/default.metallib


+ 37 - 48
PDF Office/PDF Master/Class/PDFWindowController/PDFSDK/ComPDFKit.framework/Versions/A/_CodeSignature/CodeResources

@@ -6,15 +6,15 @@
 	<dict>
 		<key>Resources/Assets.car</key>
 		<data>
-		UlWbqdfXO52si+nmlS2gVgXXEN4=
+		Lsv7/Q81njxGwXBA8bI9Dpf4F1w=
 		</data>
 		<key>Resources/CPDFUnlockViewController.nib/keyedobjects-101300.nib</key>
 		<data>
-		WWbJH/mkNN2q0uLETXjvlNRlcAQ=
+		e/XSIlGXrK/XQ3MPSq17IjdvEEo=
 		</data>
 		<key>Resources/CPDFUnlockViewController.nib/keyedobjects.nib</key>
 		<data>
-		dRWDU96uUk0Hy6R6fw3WiuV5+Tc=
+		Dv5ax23hZ/GohlG6yLpCpgKtmBE=
 		</data>
 		<key>Resources/Cert/0d264c89.0</key>
 		<data>
@@ -46,11 +46,11 @@
 		</data>
 		<key>Resources/Info.plist</key>
 		<data>
-		s+LRDesmHHues519KQPS6Fgg3IA=
+		Hoq1bHhFMnOVJoMAfRXpu6wD6fY=
 		</data>
 		<key>Resources/default.metallib</key>
 		<data>
-		PWgVqT4CtBAWiJxWMT4peo9xRa4=
+		gXenGNieYcPTigUVTHWPzj8Ru6s=
 		</data>
 		<key>Resources/empty_password.png</key>
 		<data>
@@ -460,11 +460,11 @@
 		<dict>
 			<key>hash</key>
 			<data>
-			XhZJKpgzV170H7+JlTNXmvDKV28=
+			y97Z+DpGuzRiNJeuPOcYJOAjP7c=
 			</data>
 			<key>hash2</key>
 			<data>
-			hx+o7Pm7qSpmEYr2wZ2oNi6CuOLtD2ls9CFES+mv1oE=
+			SYsacl3ktuJEOonLQaVQc5pyMF3XrQurNdURcZ/c6PA=
 			</data>
 		</dict>
 		<key>Headers/CPDFFont.h</key>
@@ -548,33 +548,33 @@
 		<dict>
 			<key>hash</key>
 			<data>
-			y9Bg+x1YnlPpVzHY9xNqbBxIDM4=
+			EcXMLodCRLFnGEvKG+5KldXSFDw=
 			</data>
 			<key>hash2</key>
 			<data>
-			mUHIviYBiivenjcw9f+AlJu4KJ4bbjsgHxHoSSGgmBY=
+			O96w/waQdpWL6LmCObzqH5qv2dtK85nAb/N+dCFF1pE=
 			</data>
 		</dict>
 		<key>Headers/CPDFKitConfig+Private.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			QU40PNSdsDL5SPxPBh9vMbKOCwc=
+			x1aYazjjBr3ixZ7KEN+ZWXUTPgg=
 			</data>
 			<key>hash2</key>
 			<data>
-			5TiHsxCowb0uqlweaj6gOdu3OrvfgTWGEEpZpPkP0kg=
+			dnKK5nPfa+EVzqJxukvQVdCuc6GdNRdR4RlMSTJD0uc=
 			</data>
 		</dict>
 		<key>Headers/CPDFKitConfig.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			OxEfUUaAJW5+1NQlhKPDDr3d0xI=
+			OBkRjNohyfKPhwG1Js5Jto1p/ZI=
 			</data>
 			<key>hash2</key>
 			<data>
-			B76IoMNcQSB8gKiVEFjSpGqAOLCjqxajfLqTCs+VP8g=
+			dvWbg/U+9mfpQu/PWX2bKzwntt2HVkKr1dt7zxaqdig=
 			</data>
 		</dict>
 		<key>Headers/CPDFKitPlatform.h</key>
@@ -702,11 +702,11 @@
 		<dict>
 			<key>hash</key>
 			<data>
-			auEHgSSysP+QSEGQLtNP7Lwp2Hw=
+			h+yJmC4Zs6cvtETiDfSIeCaXpfs=
 			</data>
 			<key>hash2</key>
 			<data>
-			HV1EAL7N0uO83ECuicMh35kilQqrL4gSrglG0FslgQI=
+			PUhkSMmyGx+gbxpfvxjEnx86Tt9A6fdmisoG75QOcYk=
 			</data>
 		</dict>
 		<key>Headers/CPDFPage+Utilities.h</key>
@@ -735,22 +735,22 @@
 		<dict>
 			<key>hash</key>
 			<data>
-			KGjgUrXClbXjFoQ13T5ykL3Q0Lk=
+			cP04w/sB4HcoTdN4u6iFbLfoEIM=
 			</data>
 			<key>hash2</key>
 			<data>
-			mMYbUT36RYTyGOo6gaZuKKdPzZ2hiG0QQdNTec1TXfk=
+			FCQihxKgbI+1/le/jh/y+Sn0ytaIellQqKse6FvvHGY=
 			</data>
 		</dict>
 		<key>Headers/CPDFPageView_Mac.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			TPEKhaqDt5LStP1M9kg5BEYOyTE=
+			6K5ZtpCAii5vSV6Ipbd2q04cUz0=
 			</data>
 			<key>hash2</key>
 			<data>
-			M3hpHAxJ2ssGrzT1MOfncRiw7a5FPYM67PciKArurRc=
+			miGsyJaFp12T95zHcbwT4namxWyP+6jkwW3vEdOEqms=
 			</data>
 		</dict>
 		<key>Headers/CPDFPerimeterMeasureInfo.h</key>
@@ -1010,11 +1010,11 @@
 		<dict>
 			<key>hash</key>
 			<data>
-			zqRKd5vICTWLP84bqeLiSiwlGxo=
+			Hvw0TSaf3UoPoRKfV8Xup6ZfGaw=
 			</data>
 			<key>hash2</key>
 			<data>
-			CjCyRf4+JqXiPrUa0CO7mKZYiF4wqP43DBln+czNgIY=
+			XRsNIcPL8R9UdgtarrFzFs0YaEo8RU+MEu+Er84m+e8=
 			</data>
 		</dict>
 		<key>Headers/CPDFView+Utilities.h</key>
@@ -1032,11 +1032,11 @@
 		<dict>
 			<key>hash</key>
 			<data>
-			QB2w4pIbwq0irsfbqwfoULu/53Q=
+			pQBxzwShjOFReHqkS5N6Y9rc8iQ=
 			</data>
 			<key>hash2</key>
 			<data>
-			2GxHeg7b00kASGfAgfwRzHYk1JTLVCYxmLyFcgubvvk=
+			AcUyN6zcvHZ2FEYpTs+3PldlZsgUhymtfhhHwb4cM3k=
 			</data>
 		</dict>
 		<key>Headers/CPDFWatermark+Protected.h</key>
@@ -1083,70 +1083,59 @@
 			kiYwPKv36pegW+kKa0q+eWvUA1yp6aIvtEtwB7+3adQ=
 			</data>
 		</dict>
-		<key>Headers/CTaskQueueManager.h</key>
-		<dict>
-			<key>hash</key>
-			<data>
-			KkeLLP94uCu2UPcgFt9XQWQi+Bs=
-			</data>
-			<key>hash2</key>
-			<data>
-			7ZNcZGW7oTu8rNljut0usNSWF20GMAF/pWTHwS5pc84=
-			</data>
-		</dict>
 		<key>Headers/ComPDFKit.h</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			iHtpayRTkdnJHp9zar0LEKVMFlg=
+			BnrIwCbWvchYZOdAZ7xY6zzyTAo=
 			</data>
 			<key>hash2</key>
 			<data>
-			7xVPYAp3mibi4zyo5FxD0G8izcQ1tjBNiOPTPYWOJLE=
+			52BrtglrC3KSOiicjScw9nq/DAzqcr+hjEh0kbYrVwA=
 			</data>
 		</dict>
 		<key>Modules/module.modulemap</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			GJse0j0x4wLzigM/YeAjcM+nZxQ=
+			LiQoiZ0HQqg8PLvhYGe2l6sUM/Q=
 			</data>
 			<key>hash2</key>
 			<data>
-			iQcHR0nTiFjwgQN3izRKSCofKuNTCmNsv4iXpEARTgc=
+			AAkcPQ+8lTvgjXGHEKzmPSMjAW0mw1D0ReUK5G9YEwQ=
 			</data>
 		</dict>
 		<key>Resources/Assets.car</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			UlWbqdfXO52si+nmlS2gVgXXEN4=
+			Lsv7/Q81njxGwXBA8bI9Dpf4F1w=
 			</data>
 			<key>hash2</key>
 			<data>
-			DzpiBgAOKtgBBasPN6omeqK0Twl09xqBD3H0phK1HcU=
+			PHXwNJNPYSsfT1XIPEdwX2PrSmexDOCEb4tCnkhHshk=
 			</data>
 		</dict>
 		<key>Resources/CPDFUnlockViewController.nib/keyedobjects-101300.nib</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			WWbJH/mkNN2q0uLETXjvlNRlcAQ=
+			e/XSIlGXrK/XQ3MPSq17IjdvEEo=
 			</data>
 			<key>hash2</key>
 			<data>
-			VhdkFTWYOUDHoZdvkZgwIgVNDt8Vj7h0sUxpPKvyjGw=
+			Cci8sTloeOT1JTL92WrgtxN/YiPEzExX+pbP8X68m+Q=
 			</data>
 		</dict>
 		<key>Resources/CPDFUnlockViewController.nib/keyedobjects.nib</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			dRWDU96uUk0Hy6R6fw3WiuV5+Tc=
+			Dv5ax23hZ/GohlG6yLpCpgKtmBE=
 			</data>
 			<key>hash2</key>
 			<data>
-			8puPkEjA9zB7vITJGCll+ZMXd+s8tKMT/p5YgHr/z3g=
+			u30610+slEfn4T8al/uF0uaEk6zWaMgecsgOru7puII=
 			</data>
 		</dict>
 		<key>Resources/Cert/0d264c89.0</key>
@@ -1230,22 +1219,22 @@
 		<dict>
 			<key>hash</key>
 			<data>
-			s+LRDesmHHues519KQPS6Fgg3IA=
+			Hoq1bHhFMnOVJoMAfRXpu6wD6fY=
 			</data>
 			<key>hash2</key>
 			<data>
-			C/NHla1BfoG+h822rED/X0su48pTBnbGMH5Sv9DJftM=
+			BdRjiKJrHT45/uoFJgLCbbEa2fI7njv5yVbGEohAhqY=
 			</data>
 		</dict>
 		<key>Resources/default.metallib</key>
 		<dict>
 			<key>hash</key>
 			<data>
-			PWgVqT4CtBAWiJxWMT4peo9xRa4=
+			gXenGNieYcPTigUVTHWPzj8Ru6s=
 			</data>
 			<key>hash2</key>
 			<data>
-			c9ASF45+FqyvK6yt+pau86rzg7KJekcYdRY7lglPRs4=
+			oAFF7yW6i+swa281kawm566So3WcP1y5lfdt0q9yEkA=
 			</data>
 		</dict>
 		<key>Resources/empty_password.png</key>

+ 3 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/From/KMFormModel.swift

@@ -16,7 +16,9 @@ class KMFormModel: NSObject {
     class func getFormAnnotations(document:CPDFDocument) -> [KMFormModel] {
         var formAnnotations : [KMFormModel] = []
         for i in 0..<document.pageCount {
-            let page : CPDFPage = document.page(at: i)
+            guard let page : CPDFPage = document.page(at: i) else {
+                continue
+            }
             var pageModels : [KMFormModel] = []
             for annotation in page.annotations {
                 var formModel = KMFormModel()

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController.swift

@@ -1421,7 +1421,7 @@ extension KMLeftSideViewController: NSTableViewDelegate, NSTableViewDataSource {
                                     if success && resultPassword.isEmpty == false {
                                         self.model.insertedDocumentSet.insert(pdf!)
                                         for i in 0 ..< (pdf?.pageCount ?? 0) {
-                                            if let page = pdf?.page(at: i).copy() as? CPDFPage {
+                                            if let page = pdf?.page(at: i)?.copy() as? CPDFPage {
                                                 self.pdfDocument()?.insertPageObject(page, at: UInt(index))
                                                 insertIndexSet.insert(index)
                                                 index += 1

+ 27 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Search/KMBotaSearchViewController.swift

@@ -10,6 +10,9 @@ import Cocoa
 class KMBotaSearchViewController: NSViewController {
     @IBOutlet weak var searchField: NSSearchField!
     @IBOutlet weak var segmentedControl: KMSegmentedControl!
+    
+    @IBOutlet weak var topView: NSBox!
+    
     var contentView: NSView? {
         didSet {
             if let view = self.contentView {
@@ -32,11 +35,16 @@ class KMBotaSearchViewController: NSViewController {
     @IBOutlet var scrollView: NSScrollView!
     @IBOutlet weak var tableView: KMBotaTableView!
     
+    private lazy var topContentView_: KMNBotaSearchTopView? = {
+        let view = KMNBotaSearchTopView.createFromNib()
+        return view
+    }()
+    
     var handdler = KMNSearchHanddler()
     
     var searchResults : [KMSearchMode] = [] {
         didSet {
-//            self.updataLeftSideFindView()
+            self.updataLeftSideFindView()
         }
     }
     
@@ -49,6 +57,12 @@ class KMBotaSearchViewController: NSViewController {
     override func loadView() {
         super.loadView()
         
+        if let data = topContentView_ {
+//            topView.contentView = topContentView_
+            topContentView_?.wantsLayer = true
+            topContentView_?.layer?.backgroundColor = NSColor.red.cgColor
+        }
+        
         self.emptySearchLabel.stringValue = KMLocalizedString("No Results")
         self.emptySearchLabel.textColor = KMAppearance.Layout.h1Color()
         self.emptyBox.fillColor = KMAppearance.Layout.l0Color()
@@ -183,9 +197,21 @@ class KMBotaSearchViewController: NSViewController {
 //        self.delegate?.searchAction?(searchString: sender.stringValue, isCase: self.mwcFlags.caseInsensitiveSearch == 1)
         
         handdler.search(keyword: sender.stringValue, isCase: false, isWholeWord: false) { [weak self] results in
+            self?.searchResults = results ?? []
             self?.tableView.reloadData()
         }
     }
+    
+    func updataLeftSideFindView() {
+        if (self.searchResults.count > 0) {
+            self.emptyBox.isHidden = true
+            self.searchResultsView.isHidden = false
+            self.searchResultsLabel.stringValue = String(format: KMLocalizedString("%ld Results"), self.searchResults.count)
+        } else {
+            self.emptyBox.isHidden = false
+            self.searchResultsView.isHidden = true
+        }
+    }
 }
 
 // MARK: - NSTableViewDelegate, NSTableViewDataSource

+ 12 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Search/KMBotaSearchViewController.xib

@@ -22,6 +22,7 @@
                 <outlet property="searchTips" destination="LV8-kC-pPy" id="vhL-vd-TBZ"/>
                 <outlet property="segmentedControl" destination="2OM-I5-WuT" id="hoB-xe-Aav"/>
                 <outlet property="tableView" destination="QYw-8e-Jnj" id="TGk-gM-Ff7"/>
+                <outlet property="topView" destination="N6c-s0-ocg" id="K55-rt-wdv"/>
                 <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
             </connections>
         </customObject>
@@ -196,6 +197,13 @@
                         <action selector="searchDomeButtonAtion:" target="-2" id="6wa-gN-8qu"/>
                     </connections>
                 </button>
+                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="N6c-s0-ocg">
+                    <rect key="frame" x="0.0" y="422" width="240" height="91"/>
+                    <view key="contentView" id="Rh3-0t-oum">
+                        <rect key="frame" x="1" y="1" width="238" height="89"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                    </view>
+                </box>
             </subviews>
             <constraints>
                 <constraint firstItem="hP4-NA-Ala" firstAttribute="top" secondItem="Exf-lV-10v" secondAttribute="bottom" constant="8" id="1Kg-bg-LGr"/>
@@ -207,18 +215,22 @@
                 <constraint firstAttribute="trailing" secondItem="m5j-WZ-WP4" secondAttribute="trailing" constant="16" id="RpE-ng-ElP"/>
                 <constraint firstItem="ZGS-QS-aFB" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="SOD-0k-NPp"/>
                 <constraint firstItem="YP3-hM-jIu" firstAttribute="height" secondItem="jTx-lq-IMO" secondAttribute="height" id="Swr-lv-cAz"/>
+                <constraint firstItem="N6c-s0-ocg" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="TY9-6v-k6I"/>
                 <constraint firstItem="m5j-WZ-WP4" firstAttribute="leading" secondItem="Exf-lV-10v" secondAttribute="leading" id="Vnk-Pc-Nhr"/>
                 <constraint firstItem="hP4-NA-Ala" firstAttribute="leading" secondItem="m5j-WZ-WP4" secondAttribute="leading" id="Wgl-cP-RDF"/>
                 <constraint firstItem="m5j-WZ-WP4" firstAttribute="top" secondItem="Exf-lV-10v" secondAttribute="top" id="Wm2-5T-Veu"/>
                 <constraint firstAttribute="trailing" secondItem="Sot-lU-418" secondAttribute="trailing" constant="16" id="XMf-el-u9F"/>
                 <constraint firstItem="2OM-I5-WuT" firstAttribute="centerY" secondItem="ZGS-QS-aFB" secondAttribute="centerY" id="Z3A-Y9-HK5"/>
                 <constraint firstItem="2OM-I5-WuT" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="8" id="d8L-Cb-uC8"/>
+                <constraint firstItem="jTx-lq-IMO" firstAttribute="top" secondItem="N6c-s0-ocg" secondAttribute="bottom" id="fxI-PG-yX7"/>
                 <constraint firstItem="YP3-hM-jIu" firstAttribute="width" secondItem="jTx-lq-IMO" secondAttribute="width" id="g2b-zR-cbj"/>
                 <constraint firstItem="Sot-lU-418" firstAttribute="centerY" secondItem="Exf-lV-10v" secondAttribute="centerY" id="gac-i5-Jlm"/>
                 <constraint firstItem="m5j-WZ-WP4" firstAttribute="top" secondItem="2OM-I5-WuT" secondAttribute="bottom" constant="8" id="gbI-es-zpr"/>
                 <constraint firstAttribute="trailing" secondItem="2OM-I5-WuT" secondAttribute="trailing" constant="6" id="o9z-IY-CCJ"/>
                 <constraint firstItem="jTx-lq-IMO" firstAttribute="top" secondItem="hP4-NA-Ala" secondAttribute="bottom" constant="8" id="oi4-Ow-iIw"/>
+                <constraint firstItem="N6c-s0-ocg" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="pW1-kZ-XbL"/>
                 <constraint firstItem="Exf-lV-10v" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="16" id="qE5-qt-cCi"/>
+                <constraint firstAttribute="trailing" secondItem="N6c-s0-ocg" secondAttribute="trailing" id="qHN-gL-kQr"/>
                 <constraint firstItem="jTx-lq-IMO" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="ski-kz-g2S"/>
                 <constraint firstItem="m5j-WZ-WP4" firstAttribute="bottom" secondItem="Exf-lV-10v" secondAttribute="bottom" id="slj-io-4Ku"/>
                 <constraint firstItem="YP3-hM-jIu" firstAttribute="centerY" secondItem="jTx-lq-IMO" secondAttribute="centerY" id="vqG-Le-4nc"/>

+ 7 - 4
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/Base/KMPDFThumbViewBaseController.swift

@@ -557,7 +557,7 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
         
         var newIndex = IndexSet()
         for indexpath in indexpaths.sorted() {
-            guard let page = self.thumbnailView.document?.page(at: UInt(indexpath.item)).copy() as? CPDFPage else {
+            guard let page = self.thumbnailView.document?.page(at: UInt(indexpath.item))?.copy() as? CPDFPage else {
                 continue
             }
             
@@ -590,7 +590,7 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
         _ = KMThumbnailManager.manager.copyPages(document: self.thumbnailView.document!, indexs: indexs)
         
         for indexpath in indexpaths.sorted() {
-            guard let page = self.thumbnailView.document?.page(at: UInt(indexpath.item)).copy() as? CPDFPage else {
+            guard let page = self.thumbnailView.document?.page(at: UInt(indexpath.item))?.copy() as? CPDFPage else {
                 continue
             }
             KMThumbnailManager.manager.copyDocument = self.thumbnailView.document
@@ -680,7 +680,10 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
         /// 提取的页面
         var extractPages: Array<CPDFPage> = []
         for i in pageIndexs {
-            extractPages.append(document.page(at: UInt(i)))
+            guard let page = document.page(at: UInt(i)) else {
+                continue
+            }
+            extractPages.append(page)
         }
         
         if (oneDocument) { /// 提取为一个文档
@@ -927,7 +930,7 @@ class KMPDFThumbViewBaseController: KMBaseViewController {
         
         var array: Array<CPDFPage> = []
         for i in indexs {
-            if let page = self.thumbnailView.document?.page(at: UInt(i)).copy() as? CPDFPage {
+            if let page = self.thumbnailView.document?.page(at: UInt(i))?.copy() as? CPDFPage {
                 array.append(page)
             }
         }

+ 6 - 4
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/KMThumbnailViewController.swift

@@ -169,7 +169,7 @@ class KMThumbnailViewController: KMBaseViewController {
         var indexTemp: Int = toIndex
         var pageItems: [KMThumbnailPageItem] = []
         for index in indexs {
-            let newPage: CPDFPage = self.listView?.document.page(at: UInt(index)).copy() as! CPDFPage
+            let newPage: CPDFPage = self.listView?.document.page(at: UInt(index))?.copy() as! CPDFPage
             let pageItem = KMThumbnailPageItem(page: newPage, index: index, oldIndex: index)
             pageItems.append(pageItem)
             if (toIndex > index) { /// 删除了插入位置前面的页面,需要改变 toIndex
@@ -616,7 +616,7 @@ class KMThumbnailViewController: KMBaseViewController {
             //本地page记录用于本文件page移动处理
             if indexs.count >= 0 {
                 for i in indexs {
-                    let page = self.thumbnailView.document?.page(at: UInt(i)).copy() as? CPDFPage
+                    let page = self.thumbnailView.document?.page(at: UInt(i))?.copy() as? CPDFPage
                     KMThumbnailManager.manager.copyPages.append(page ?? CPDFPage())
                 }
             }
@@ -631,7 +631,7 @@ class KMThumbnailViewController: KMBaseViewController {
             
             if indexs.count >= 0 {
                 for i in indexs {
-                    let page = self.thumbnailView.document?.page(at: UInt(i)).copy() as? CPDFPage
+                    let page = self.thumbnailView.document?.page(at: UInt(i))?.copy() as? CPDFPage
                     KMThumbnailManager.manager.copyPages.append(page ?? CPDFPage())
                 }
                 
@@ -728,7 +728,9 @@ extension KMThumbnailViewController : KMThumbnailViewDelegate {
 
         if thumbanView.collectionView.selectionIndexes.count == 1 || (!event.modifierFlags.contains(NSEvent.ModifierFlags.command) &&
                                                                       !event.modifierFlags.contains(NSEvent.ModifierFlags.shift)) {
-            let page : CPDFPage = self.listView.document.page(at: UInt(indexpath.item))
+            guard let page = self.listView.document.page(at: UInt(indexpath.item)) else {
+                return
+            }
             self.listView.go(toPageIndex: Int(page.pageIndex()), animated: true)
             self.thumbnailView.collectionView.deselectAll(nil)
             self.thumbnailView.collectionView.selectionIndexes = IndexSet(integer: IndexSet.Element(indexpath.item))

+ 3 - 1
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+Action.swift

@@ -137,7 +137,9 @@ extension KMMainViewController {
             self.listView.document.removeSignature(signature)
         }
         for i in 0..<self.listView.document.pageCount {
-            let page : CPDFPage = self.listView.document.page(at: i)
+            guard let page = self.listView.document.page(at: i) else {
+                continue
+            }
             let annotations : [CPDFAnnotation] = page.annotations
             for j in 0..<annotations.count {
                 let annotation = annotations[j]

+ 6 - 2
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+MenuAction.swift

@@ -1013,7 +1013,9 @@ extension KMMainViewController: KMSystemToolMenuProtocol {
         Task { @MainActor in
             var pageItems: [KMThumbnailPageItem] = []
             for index in 0 ... self.listView.document.pageCount - 1 {
-                let page: CPDFPage = self.listView.document.page(at: index)
+                guard let page: CPDFPage = self.listView.document.page(at: index) else {
+                    continue
+                }
                 let rotation = page.rotation
                 page.leftRotate()
                 pageItems.append(KMThumbnailPageItem(page: page, rotate: page.rotation, oldRotate: rotation))
@@ -1033,7 +1035,9 @@ extension KMMainViewController: KMSystemToolMenuProtocol {
         Task { @MainActor in
             var pageItems: [KMThumbnailPageItem] = []
             for index in 0 ... self.listView.document.pageCount - 1 {
-                let page: CPDFPage = self.listView.document.page(at: index)
+                guard let page: CPDFPage = self.listView.document.page(at: index) else {
+                    continue
+                }
                 let rotation = page.rotation
                 page.rightRotate()
                 pageItems.append(KMThumbnailPageItem(page: page, rotate: page.rotation, oldRotate: rotation))

+ 4 - 2
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailManager.swift

@@ -61,7 +61,8 @@ public class KMNThumbnail: NSObject {
             try? FileManager.default.createDirectory(atPath: docsFilePath, withIntermediateDirectories: true, attributes: nil)
         }
         
-        let pageObjNum = thumbnaiPage?.getObjNum() ?? -1 //获取Page的唯一标识码
+//        let pageObjNum = thumbnaiPage?.getObjNum() ?? -1 //获取Page的唯一标识码
+        let pageObjNum = 1000
         var imageFilePath = ""
 
         if(pageObjNum == -1) {
@@ -159,7 +160,8 @@ public class KMNThumbnail: NSObject {
         let docsFilePath = kmnThumbnailFolder + "/" + filePathID
         let fileManager = FileManager.default
 
-        let pageObjNum = thumbnaiPage?.getObjNum() ?? -1
+//        let pageObjNum = thumbnaiPage?.getObjNum() ?? -1
+        let pageObjNum = 1000
         var imageFilePath = ""
 
         if(pageObjNum == -1) {

+ 6 - 3
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailBaseViewController+Action.swift

@@ -462,7 +462,10 @@ extension KMNThumbnailBaseViewController {
         /// 提取的页面
         var extractPages: Array<CPDFPage> = []
         for i in pageIndexs {
-            extractPages.append(document.page(at: UInt(i)))
+            guard let page = document.page(at: UInt(i)) else {
+                continue
+            }
+            extractPages.append(page)
         }
         
         if (oneDocument) { /// 提取为一个文档
@@ -554,7 +557,7 @@ extension KMNThumbnailBaseViewController {
         
         let indexpaths = collectionView.selectionIndexPaths
         for indexpath in indexpaths.sorted() {
-            guard let page = showDocument?.page(at: UInt(indexpath.item)).copy() as? CPDFPage else {
+            guard let page = showDocument?.page(at: UInt(indexpath.item))?.copy() as? CPDFPage else {
                 continue
             }
             
@@ -633,7 +636,7 @@ extension KMNThumbnailBaseViewController {
         
         let indexpaths = collectionView.selectionIndexPaths
         for indexpath in indexpaths.sorted() {
-            guard let page = showDocument?.page(at: UInt(indexpath.item)).copy() as? CPDFPage else {
+            guard let page = showDocument?.page(at: UInt(indexpath.item))?.copy() as? CPDFPage else {
                 continue
             }
             

+ 1 - 1
PDF Office/PDF Master/KMClass/KMPDFViewController/EditTool/SinglePagePDFController/KMEditDocumentController.swift

@@ -42,7 +42,7 @@ class KMEditDocumentController: NSViewController {
     }
     
     func layoutDocumentView() {
-        pdfView.document?.refreshPageData()
+//        pdfView.document?.refreshPageData()
         pdfView.layoutDocumentView()
         
     }

+ 5 - 5
PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift

@@ -1208,7 +1208,7 @@ struct KMNMWCFlags {
             let background = listView.document.background()
             background?.clear()
             
-            listView.document?.refreshPageData()
+//            listView.document?.refreshPageData()
             listView.layoutDocumentView()
             
             _ = KMNCustomAlertView.alertView(message: KMLocalizedString("Background removed"),
@@ -1281,7 +1281,7 @@ struct KMNMWCFlags {
             let headerFooter = listView.document.headerFooter()
             headerFooter?.clear()
             
-            listView.document?.refreshPageData()
+//            listView.document?.refreshPageData()
             listView.layoutDocumentView()
             
             _ = KMNCustomAlertView.alertView(message: KMLocalizedString("Header & Footer removed"),
@@ -1356,7 +1356,7 @@ struct KMNMWCFlags {
             let bates = listView.document.bates()
             bates?.clear()
             
-            listView.document?.refreshPageData()
+//            listView.document?.refreshPageData()
             listView.layoutDocumentView()
             
             _ = KMNCustomAlertView.alertView(message: KMLocalizedString("Bates removed"),
@@ -2260,7 +2260,7 @@ extension KMMainViewController: KMEditToolbarViewDelegate {
                     background.pageString = pageString
                     background.update()
                     
-                    listView.document?.refreshPageData()
+//                    listView.document?.refreshPageData()
                     listView.layoutDocumentView()
                 }
             }
@@ -2273,7 +2273,7 @@ extension KMMainViewController: KMEditToolbarViewDelegate {
                     headerFooter.pageString = pageString
                     headerFooter.update()
                     
-                    listView.document?.refreshPageData()
+//                    listView.document?.refreshPageData()
                     listView.layoutDocumentView()
                 }
             }

+ 55 - 0
PDF Office/PDF Master/KMClass/Left/Search/View/KMNBotaSearchTopView.swift

@@ -0,0 +1,55 @@
+//
+//  KMNBotaSearchTopVIew.swift
+//  PDF Reader Pro
+//
+//  Created by User-Tangchao on 2024/12/1.
+//
+
+import Cocoa
+import KMComponentLibrary
+
+class KMNBotaSearchTopView: NSView, NibLoadable {
+    
+    @IBOutlet weak var topBox: NSBox!
+    @IBOutlet weak var centerBox: NSBox!
+    @IBOutlet weak var bottomBox: NSBox!
+    
+    @IBOutlet weak var centerHeightConst: NSLayoutConstraint!
+    
+    private lazy var searchButton_: ComponentButton = {
+        let view = ComponentButton()
+        view.properties = ComponentButtonProperty(type: .text_gray, size: .xxxs, state: .normal, onlyIcon: true, icon: NSImage(named: "KMImageNameBotaSearch"))
+        return view
+    }()
+    
+    private lazy var input_: ComponentInput = {
+        let view = ComponentInput()
+        view.properties = ComponentInputProperty(size: .s, placeholder: KMLocalizedString("Search"), text: "")
+        return view
+    }()
+    
+    private lazy var closeButton_: ComponentButton = {
+        let view = ComponentButton()
+        view.properties = ComponentButtonProperty(type: .text_gray_low, size: .xxs, state: .normal, onlyIcon: true, icon: NSImage(named: "KMImageNameBotaClose"))
+        return view
+    }()
+    
+    override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+
+        // Drawing code here.
+    }
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        
+        initSubviews()
+    }
+    
+    func initSubviews() {
+        topBox.contentView?.addSubview(searchButton_)
+        searchButton_.km_add_leading_constraint(constant: 12)
+        searchButton_.km_add_size_constraint(size: NSSize(width: 16, height: 16))
+        searchButton_.km_add_centerY_constraint()
+    }
+}

+ 67 - 0
PDF Office/PDF Master/KMClass/Left/Search/View/KMNBotaSearchTopView.xib

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner"/>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe" customClass="KMNBotaSearchTopView" customModule="PDF_Reader_Pro" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="ani-z1-IIg">
+                    <rect key="frame" x="0.0" y="232" width="480" height="40"/>
+                    <view key="contentView" id="ufB-CJ-Qi4">
+                        <rect key="frame" x="1" y="1" width="478" height="38"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                    </view>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="40" id="5Kb-8x-5jw"/>
+                    </constraints>
+                </box>
+                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="FlM-dE-vdh">
+                    <rect key="frame" x="0.0" y="160" width="480" height="72"/>
+                    <view key="contentView" id="5XQ-8R-qbR">
+                        <rect key="frame" x="1" y="1" width="478" height="70"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                    </view>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="72" id="Meh-3O-QjM"/>
+                    </constraints>
+                </box>
+                <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="5fA-dZ-SXU">
+                    <rect key="frame" x="0.0" y="120" width="480" height="40"/>
+                    <view key="contentView" id="OwS-LP-QKa">
+                        <rect key="frame" x="1" y="1" width="478" height="38"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                    </view>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="40" id="yr1-Ed-Lau"/>
+                    </constraints>
+                </box>
+            </subviews>
+            <constraints>
+                <constraint firstAttribute="trailing" secondItem="FlM-dE-vdh" secondAttribute="trailing" id="2V7-RV-7b4"/>
+                <constraint firstAttribute="trailing" secondItem="5fA-dZ-SXU" secondAttribute="trailing" id="5tl-ab-QMX"/>
+                <constraint firstItem="5fA-dZ-SXU" firstAttribute="top" secondItem="FlM-dE-vdh" secondAttribute="bottom" id="KMf-da-5qP"/>
+                <constraint firstItem="ani-z1-IIg" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="L0s-ex-8ov"/>
+                <constraint firstItem="ani-z1-IIg" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="TFn-oA-Ayl"/>
+                <constraint firstItem="FlM-dE-vdh" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="U27-G8-4t9"/>
+                <constraint firstItem="5fA-dZ-SXU" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="g0J-cg-iww"/>
+                <constraint firstAttribute="trailing" secondItem="ani-z1-IIg" secondAttribute="trailing" id="jIb-RC-Fif"/>
+                <constraint firstItem="FlM-dE-vdh" firstAttribute="top" secondItem="ani-z1-IIg" secondAttribute="bottom" id="uBQ-wl-kgZ"/>
+            </constraints>
+            <connections>
+                <outlet property="bottomBox" destination="5fA-dZ-SXU" id="nq7-k7-V8N"/>
+                <outlet property="centerBox" destination="FlM-dE-vdh" id="MRP-lK-Nkj"/>
+                <outlet property="centerHeightConst" destination="Meh-3O-QjM" id="33z-5c-a8T"/>
+                <outlet property="topBox" destination="ani-z1-IIg" id="8yt-Ls-mhP"/>
+            </connections>
+            <point key="canvasLocation" x="-40" y="75"/>
+        </customView>
+    </objects>
+</document>

+ 24 - 0
PDF Office/PDF Reader Pro.xcodeproj/project.pbxproj

@@ -349,6 +349,12 @@
 		65F9F4852CFC16A100F187A8 /* KMNSearchHanddler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F9F4842CFC16A100F187A8 /* KMNSearchHanddler.swift */; };
 		65F9F4862CFC16A100F187A8 /* KMNSearchHanddler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F9F4842CFC16A100F187A8 /* KMNSearchHanddler.swift */; };
 		65F9F4872CFC16A100F187A8 /* KMNSearchHanddler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F9F4842CFC16A100F187A8 /* KMNSearchHanddler.swift */; };
+		65F9F48A2CFCABD100F187A8 /* KMNBotaSearchTopView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F9F4892CFCABD100F187A8 /* KMNBotaSearchTopView.swift */; };
+		65F9F48B2CFCABD100F187A8 /* KMNBotaSearchTopView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F9F4892CFCABD100F187A8 /* KMNBotaSearchTopView.swift */; };
+		65F9F48C2CFCABD100F187A8 /* KMNBotaSearchTopView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F9F4892CFCABD100F187A8 /* KMNBotaSearchTopView.swift */; };
+		65F9F48E2CFCABE700F187A8 /* KMNBotaSearchTopView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F9F48D2CFCABE700F187A8 /* KMNBotaSearchTopView.xib */; };
+		65F9F48F2CFCABE700F187A8 /* KMNBotaSearchTopView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F9F48D2CFCABE700F187A8 /* KMNBotaSearchTopView.xib */; };
+		65F9F4902CFCABE700F187A8 /* KMNBotaSearchTopView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F9F48D2CFCABE700F187A8 /* KMNBotaSearchTopView.xib */; };
 		65FABB312C9AFB0C00AA92E5 /* KMSectionCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FABB302C9AFB0C00AA92E5 /* KMSectionCellView.swift */; };
 		65FABB322C9AFB0C00AA92E5 /* KMSectionCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FABB302C9AFB0C00AA92E5 /* KMSectionCellView.swift */; };
 		65FABB332C9AFB0C00AA92E5 /* KMSectionCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FABB302C9AFB0C00AA92E5 /* KMSectionCellView.swift */; };
@@ -5670,6 +5676,8 @@
 		65EF3A7C2C81C1F500CCFC8F /* KMVerificationRSA.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KMVerificationRSA.swift; sourceTree = "<group>"; };
 		65F9F47E2CFB5C3500F187A8 /* KMNBotaBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMNBotaBaseViewController.swift; sourceTree = "<group>"; };
 		65F9F4842CFC16A100F187A8 /* KMNSearchHanddler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMNSearchHanddler.swift; sourceTree = "<group>"; };
+		65F9F4892CFCABD100F187A8 /* KMNBotaSearchTopView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMNBotaSearchTopView.swift; sourceTree = "<group>"; };
+		65F9F48D2CFCABE700F187A8 /* KMNBotaSearchTopView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMNBotaSearchTopView.xib; sourceTree = "<group>"; };
 		65FABB302C9AFB0C00AA92E5 /* KMSectionCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KMSectionCellView.swift; sourceTree = "<group>"; };
 		65FABB342C9AFB1F00AA92E5 /* KMSectionCellView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = KMSectionCellView.xib; sourceTree = "<group>"; };
 		8931681F296D73CC0073EA59 /* KMSignatureAnnotationViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KMSignatureAnnotationViewController.h; sourceTree = "<group>"; };
@@ -8250,6 +8258,7 @@
 		65F9F4822CFC162B00F187A8 /* Search */ = {
 			isa = PBXGroup;
 			children = (
+				65F9F4882CFCAA1300F187A8 /* View */,
 				65F9F4832CFC162B00F187A8 /* Tools */,
 			);
 			path = Search;
@@ -8263,6 +8272,15 @@
 			path = Tools;
 			sourceTree = "<group>";
 		};
+		65F9F4882CFCAA1300F187A8 /* View */ = {
+			isa = PBXGroup;
+			children = (
+				65F9F4892CFCABD100F187A8 /* KMNBotaSearchTopView.swift */,
+				65F9F48D2CFCABE700F187A8 /* KMNBotaSearchTopView.xib */,
+			);
+			path = View;
+			sourceTree = "<group>";
+		};
 		8931681E296D73C10073EA59 /* Signature */ = {
 			isa = PBXGroup;
 			children = (
@@ -15029,6 +15047,7 @@
 				ADBC372429CA923E00D93208 /* KMComparative.plist in Resources */,
 				653647B62CDCA5DE00CDB13E /* KMBatchOperateBaseWindowController.xib in Resources */,
 				AD3AAD562B0D87E500DE5FE7 /* KMCompareThumbItem.xib in Resources */,
+				65F9F48E2CFCABE700F187A8 /* KMNBotaSearchTopView.xib in Resources */,
 				9FD0FA3429CD947000F2AB0D /* KMOpacityPanel.xib in Resources */,
 				BB8810A32B4F7D1000AFA63E /* KMVerificationActivateViewController.xib in Resources */,
 				BBB789B42BE8BF2400F7E09C /* AIChatStringUploadItem.xib in Resources */,
@@ -15431,6 +15450,7 @@
 				651675BF2CE3312000019A20 /* KMBOTAOutlineCellView.xib in Resources */,
 				BBE788A32CBD2463008086E2 /* DropdownDemoVC.xib in Resources */,
 				F337CC492CC7EEE100D46AF4 /* KMNPDFInsertPDFWindowController.xib in Resources */,
+				65F9F48F2CFCABE700F187A8 /* KMNBotaSearchTopView.xib in Resources */,
 				ADFA8F0E2B579957002595A4 /* KMSearchFindView.xib in Resources */,
 				BBFD22632CBE16B200DA4ABD /* KMHistoryEmptyView.xib in Resources */,
 				AD7D5CE92B96B3B2006562CD /* KMBookmarkOutlineSeparatorCellView.xib in Resources */,
@@ -16001,6 +16021,7 @@
 				AD1FE8222BD7C98300AA4A9B /* KMPDFBookletWindowController.xib in Resources */,
 				BB69C961299116FD0001A9B1 /* plaid.pdf in Resources */,
 				ADDF83912B391A5D00A81A4E /* DSignDetailTypeACellView.xib in Resources */,
+				65F9F4902CFCABE700F187A8 /* KMNBotaSearchTopView.xib in Resources */,
 				9F0CB4AC296CF19600007028 /* KMPropertiesPanelListMenuSubVC.xib in Resources */,
 				BB9599C92B3164B40062D346 /* KMRedactPropertiesWindowController.xib in Resources */,
 				ADB2D6FF294882B70029D2B3 /* KMTextFieldStepperView.xib in Resources */,
@@ -16758,6 +16779,7 @@
 				BBD14F5F2CDA16080077D52E /* KMWatermarkSaveWindow.swift in Sources */,
 				BB9EA1572B1EEAAC00EAFD9B /* KMImageModel.swift in Sources */,
 				BBDA8A6D2A31F9A6006A2C4E /* KMDesignStepperView.swift in Sources */,
+				65F9F48A2CFCABD100F187A8 /* KMNBotaSearchTopView.swift in Sources */,
 				F30B227C2CB7DAF10041002E /* KMNQuickToolWindowController.swift in Sources */,
 				BBFDFA9E2AF3814000E08AA2 /* KMTextHintWindowController.swift in Sources */,
 				ADE86AF72B0AF59A00414DFA /* KMCompareContentSettingView.swift in Sources */,
@@ -18847,6 +18869,7 @@
 				BB146FCA299DC0D100784A6A /* GTMSessionFetcher.m in Sources */,
 				BBC70EB52AEA847500AC1585 /* KMToolbarCustomViewController.swift in Sources */,
 				BB6B4C09292F53CE0071CA06 /* KMMergeFileModel.swift in Sources */,
+				65F9F48B2CFCABD100F187A8 /* KMNBotaSearchTopView.swift in Sources */,
 				AD0E8AB52A31B78900DBFD3C /* KMDMGPurchaseManager.swift in Sources */,
 				BBB7898B2BE8BF2300F7E09C /* AIHeaderView.swift in Sources */,
 				F3D395682CBD2C6D000C6729 /* KMNCustomAlertView.swift in Sources */,
@@ -19485,6 +19508,7 @@
 				AD055E622B85E04C0035F824 /* KMTextWithIconCell.swift in Sources */,
 				AD055E802B88294F0035F824 /* SKBookmarkSheetController.m in Sources */,
 				65B143AC2CF06B97001B5A69 /* NSColor+KMExtensions.swift in Sources */,
+				65F9F48C2CFCABD100F187A8 /* KMNBotaSearchTopView.swift in Sources */,
 				ADDF835B2B391A5C00A81A4E /* CDSignatureCertificateStateViewController.swift in Sources */,
 				6536FDE92C9C49A6004A0FB9 /* KMNoteFooterCellView.swift in Sources */,
 				AD7D5CD12B9573FF006562CD /* KMBookmarkOutlinePageCellView.swift in Sources */,